@event(u'task.execute.completed')
def flush_task(task):
 SimplePersistence.flush(task.name)
 if task.manager.is_daemon:
  SimplePersistence.flush()

@ event ( u'task.execute.completed' ) def flush_task ( task ) : SimplePersistence . flush ( task . name ) if task . manager . is_daemon : SimplePersistence . flush ( )
stores all in memory key/value pairs to database when a task has completed .