Jelajahi Sumber

fix status duh

David 10 tahun lalu
induk
melakukan
53c53e7d88
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      pmanager/pmanager.py

+ 2 - 2
pmanager/pmanager.py

@@ -120,7 +120,6 @@ class PManager:
         if key not in self.p_list:
         if key not in self.p_list:
             log("key %s doesn't exist! not killing!" % (key))
             log("key %s doesn't exist! not killing!" % (key))
             return
             return
-        self.sendstatus()
         try:
         try:
             os.killpg(os.getpgid(self.p_list[key]), signal.SIGTERM)
             os.killpg(os.getpgid(self.p_list[key]), signal.SIGTERM)
         except Exception as e:
         except Exception as e:
@@ -136,6 +135,7 @@ class PManager:
             del self.log_list[key]
             del self.log_list[key]
     
     
         del self.p_list[key]
         del self.p_list[key]
+        self.sendstatus()
             
             
     def oneshot(self, key):
     def oneshot(self, key):
         if key not in self.ptable:
         if key not in self.ptable:
@@ -156,7 +156,6 @@ class PManager:
             log("This process (%s) is not on my table!" % key)
             log("This process (%s) is not on my table!" % key)
             return
             return
     
     
-        self.sendstatus()
         log("Launching! key: %s, opts: %s" % (key, options))
         log("Launching! key: %s, opts: %s" % (key, options))
         tolaunch = self.ptable[key]
         tolaunch = self.ptable[key]
         if options is not None:
         if options is not None:
@@ -173,6 +172,7 @@ class PManager:
             sys.exit(1)
             sys.exit(1)
 
 
         self.p_list[key] = proc.pid
         self.p_list[key] = proc.pid
+        self.sendstatus()
         return proc.pid
         return proc.pid
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":