Commits

Anonymous committed d508921

Changes to the config file cause the server to reload when using --reload

Comments (0)

Files changed (1)

paste/script/serve.py

         self.change_user_group(
             self.options.set_user, self.options.set_group)
 
-        if self.options.reload:
-            if os.environ.get(self._reloader_environ_key):
-                from paste import reloader
-                if self.verbose > 1:
-                    print 'Running reloading file monitor'
-                reloader.install(int(self.options.reload_interval))
-            else:
-                return self.restart_with_reloader()
-                
         if not self.args:
             raise BadCommand('You must give a config file')
         app_spec = self.args[0]
             cmd = self.args[1]
         else:
             cmd = None
+            
+        if self.options.reload:
+            if os.environ.get(self._reloader_environ_key):
+                from paste import reloader
+                if self.verbose > 1:
+                    print 'Running reloading file monitor'
+                reloader.install(int(self.options.reload_interval))
+                reloader.watch_file(self.args[0])
+            else:
+                return self.restart_with_reloader()
 
         if cmd not in (None, 'start', 'stop', 'restart', 'status'):
             raise BadCommand(
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.