Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load(self):
import oncall
reload(oncall.utils)
import oncall.app
app = oncall.app.get_wsgi_app()
if not self.skip_build_assets:
for r in gc.get_referrers(self):
if isinstance(r, dict) and '_num_workers' in r:
gunicorn_arbiter = r
# only build assets on one worker to avoid race conditions
if gunicorn_arbiter['worker_age'] % self.options['workers'] == 0:
import oncall.ui
oncall.ui.build_assets()
return app