Example #1
0
def init_app(app):
    if app.config.get("ENABLE_PROFILING"):
        endpoint_name = "profiling"
        service = ProfilingService(endpoint_name, backend=superdesk.get_backend())
        ProfilingResource(endpoint_name, app=app, service=service)

        superdesk.privilege(name="profiling", label="Profiling Service", description="User can read profiling data.")

        profile.enable()
Example #2
0
def init_app(app):
    if app.config.get('ENABLE_PROFILING'):
        endpoint_name = 'profiling'
        service = ProfilingService(endpoint_name,
                                   backend=superdesk.get_backend())
        ProfilingResource(endpoint_name, app=app, service=service)

        superdesk.privilege(name='profiling',
                            label='Profiling Service',
                            description='User can read profiling data.')

        profile.enable()
Example #3
0
 def __enter__(self):
     if app.config.get('ENABLE_PROFILING'):
         profile.enable()
Example #4
0
 def __enter__(self):
     if app.config.get("ENABLE_PROFILING"):
         profile.enable()