jerry 3 tygodni temu
rodzic
commit
6f0ca2d339
2 zmienionych plików z 13 dodań i 13 usunięć
  1. 2 2
      plugins/tls_plugin.py
  2. 11 11
      sentinel.py

+ 2 - 2
plugins/tls_plugin.py

@@ -246,7 +246,6 @@ class TlsPlugin(IVSPlg):
             
             time.sleep(3)
             if "login-actions" in self.page.url or "auth" in self.page.url:
-                self._save_screenshot("login_submit_fail")
                 raise BizLogicError(message="Login Failed! Invalid credentials or Captcha rejected.")
             
             self.page.wait.load_start()
@@ -324,7 +323,8 @@ class TlsPlugin(IVSPlg):
 
         except Exception as e:
             self._log(f"Session Create Error: {e}")
-            time.sleep(3600)
+            if self.config.debug:
+                self._save_screenshot("create_session_except")
             self.cleanup()
             raise e
 

+ 11 - 11
sentinel.py

@@ -74,6 +74,16 @@ class SentinelGCO:
                     weights = [float(item.weight) for item in apt_types]
                     apt_type = random.choices(apt_types, weights=weights, k=1)[0]
                     
+                    interval = 30
+                    mode = task.qw_cfg.mode
+                    if mode == QueryWaitMode.Loop:
+                        interval = 1
+                    elif mode == QueryWaitMode.Fixed:
+                        interval = task.qw_cfg.fixed_wait
+                    elif mode == QueryWaitMode.Random:
+                        interval = rng.randint(task.qw_cfg.random_min, task.qw_cfg.random_max)
+                    task.next_run = time.time() + interval
+                    
                     try:
                         VSCloudApi.Instance().slot_refresh_start(apt_type.routing_key, country=apt_type.country, city=apt_type.city, visa_type=apt_type.visa_type)
                         result = task.instance.query(apt_type)
@@ -94,21 +104,11 @@ class SentinelGCO:
                             
                             payload["query_result"]["website"] = self.m_cfg.website
                             VSCloudApi.Instance().slot_snapshot_report(payload["query_result"])
-                            
-                        interval = 30
-                        mode = task.qw_cfg.mode
-                        if mode == QueryWaitMode.Loop:
-                            interval = 1
-                        elif mode == QueryWaitMode.Fixed:
-                            interval = task.qw_cfg.fixed_wait
-                        elif mode == QueryWaitMode.Random:
-                            interval = rng.randint(task.qw_cfg.random_min, task.qw_cfg.random_max)
-                        task.next_run = time.time() + interval
 
                     except Exception as e:
                         self._log(f"Query exception: {e}")
                         VSCloudApi.Instance().slot_refresh_fail(apt_type.routing_key, error=str(e))
-                        task.next_run = time.time() + 10
+                        
             except Exception as e:
                 self._log(f"Monitor loop error: {e}")
                 time.sleep(2)