def process_event(self, event_id):
    """Process event in Celery."""
    with db.session.begin_nested():
        event = Event.query.get(event_id)
        event._celery_task = self  # internal binding to a Celery task
        event.receiver.run(event)  # call run directly to avoid circular calls
        flag_modified(event, 'response')
        flag_modified(event, 'response_headers')
        db.session.add(event)
    db.session.commit()
def process_event ( self , event_id ) : with db . session . begin_nested ( ) : event = Event . query . get ( event_id ) event . _celery_task = self event . receiver . run ( event ) flag_modified ( event , 'response' ) flag_modified ( event , 'response_headers' ) db . session . add ( event ) db . session . commit ( )
Process event in Celery.