Jelajahi Sumber

修正带绑定注册时超时时间,从300改为9223372036854775807

zii 1 bulan lalu
induk
melakukan
4efc9809b0
1 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 4 4
      src/api/auth.rs

+ 4 - 4
src/api/auth.rs

@@ -119,13 +119,13 @@ pub async fn auth(
                 } else{
                     if let Some(mq) = state.mq_detail{
                         if let Err(e)=mq.db_mq_map.execute(
-                            "insert into pub (clientid,topic,deadline)values(?,?,unixepoch()+300),(?,?,unixepoch()+300)", 
+                            "insert into pub (clientid,topic,deadline)values(?,?,unixepoch()+9223372036854775807),(?,?,unixepoch()+9223372036854775807)", 
                             (mqid.clone(),format!("{}/cmd",sn),mqid.clone(),format!("/wf/Iot/device/{sn}"))).await{
                             log(Warning, format!("on register with device: {e}"));
                         };
                         
                         if let Err(e)=mq.db_mq_map.execute(
-                            "insert into sub (clientid,topic,deadline)values(?,?,unixepoch()+300)", 
+                            "insert into sub (clientid,topic,deadline)values(?,?,unixepoch()+9223372036854775807)", 
                             (mqid.clone(),format!("{}/state",sn),mqid.clone(),format!("/wf/Iot/client/{sn}"))).await{
                             log(Warning, format!("on register with device: {e}"));
                         };
@@ -190,13 +190,13 @@ pub async fn auth(
             };
             if let Some(mq) = state.mq_detail{
                 if let Err(e)=mq.db_mq_map.execute(
-                    "insert into pub (clientid,topic,deadline)values(?,?,unixepoch()+300),(?,?,unixepoch()+300)", 
+                    "insert into pub (clientid,topic,deadline)values(?,?,unixepoch()+9223372036854775807),(?,?,unixepoch()+9223372036854775807)", 
                     (mqid.clone(),format!("{}/cmd",sn),mqid.clone(),format!("/wf/Iot/device/{sn}"))).await{
                     log(Warning, format!("on register with device: {e}"));
                 };
                 
                 if let Err(e)=mq.db_mq_map.execute(
-                    "insert into sub (clientid,topic,deadline)values(?,?,unixepoch()+300)", 
+                    "insert into sub (clientid,topic,deadline)values(?,?,unixepoch()+9223372036854775807)", 
                     (mqid.clone(),format!("{}/state",sn),mqid.clone(),format!("/wf/Iot/client/{sn}"))).await{
                     log(Warning, format!("on register with device: {e}"));
                 };