Ver Fonte

- Added 'numprocs_start' config option to '[program:x]' and
'[eventlistener:x]' sections. This is an offset used to compute
the first integer that 'numprocs' will begin to start from.
Contributed by Antonio Beamud Montero.

Chris McDonough há 17 anos atrás
pai
commit
e1529b4818
2 ficheiros alterados com 7 adições e 2 exclusões
  1. 5 0
      CHANGES.txt
  2. 2 2
      src/supervisor/options.py

+ 5 - 0
CHANGES.txt

@@ -28,6 +28,11 @@ Next Release
     appropriately).  This is a new user convenience (especially one who
     has no Python experience).
 
+  - Added 'numprocs_start' config option to '[program:x]' and
+    '[eventlistener:x]' sections.  This is an offset used to compute
+    the first integer that 'numprocs' will begin to start from.
+    Contributed by Antonio Beamud Montero.
+
 3.0a3
 
   - Supervisorctl now reports a better error message when the main

+ 2 - 2
src/supervisor/options.py

@@ -603,6 +603,7 @@ class ServerOptions(Options):
         exitcodes = list_of_exitcodes(get(section, 'exitcodes', '0,2'))
         redirect_stderr = boolean(get(section, 'redirect_stderr','false'))
         numprocs = integer(get(section, 'numprocs', 1))
+        numprocs_start = integer(get(section, 'numprocs_start', 0))
         process_name = get(section, 'process_name', '%(program_name)s')
         environment_str = get(section, 'environment', '')
         stdout_cmaxbytes = byte_size(get(section,'stdout_capture_maxbytes','0'))
@@ -640,8 +641,7 @@ class ServerOptions(Options):
                     'rollover, set maxbytes > 0 to avoid filling up '
                     'filesystem unintentionally' % (section, n))
                 
-        for process_num in range(0, numprocs):
-
+        for process_num in range(numprocs_start, numprocs + numprocs_start):
             expansions = {'here':self.here,
                           'process_num':process_num,
                           'program_name':program_name,