(self, app)
| 107 | num_workers = property(_get_num_workers, _set_num_workers) |
| 108 | |
| 109 | def setup(self, app): |
| 110 | self.app = app |
| 111 | self.cfg = app.cfg |
| 112 | |
| 113 | if self.log is None: |
| 114 | self.log = self.cfg.logger_class(app.cfg) |
| 115 | |
| 116 | # reopen files |
| 117 | if 'GUNICORN_PID' in os.environ: |
| 118 | self.log.reopen_files() |
| 119 | |
| 120 | self.worker_class = self.cfg.worker_class |
| 121 | self.address = self.cfg.address |
| 122 | self.num_workers = self.cfg.workers |
| 123 | self.timeout = self.cfg.timeout |
| 124 | self.proc_name = self.cfg.proc_name |
| 125 | |
| 126 | self.log.debug('Current configuration:\n{0}'.format( |
| 127 | '\n'.join( |
| 128 | ' {0}: {1}'.format(config, value.value) |
| 129 | for config, value |
| 130 | in sorted(self.cfg.settings.items(), |
| 131 | key=lambda setting: setting[1])))) |
| 132 | |
| 133 | # set environment' variables |
| 134 | if self.cfg.env: |
| 135 | for k, v in self.cfg.env.items(): |
| 136 | os.environ[k] = v |
| 137 | |
| 138 | if self.cfg.preload_app: |
| 139 | self.app.wsgi() |
| 140 | |
| 141 | def start(self): |
| 142 | """\ |
no test coverage detected