@connect_on_app_finalize
def add_backend_cleanup_task(app):
 @app.task(name=u'celery.backend_cleanup', shared=False, lazy=False)
 def backend_cleanup():
  app.backend.cleanup()
 return backend_cleanup

@ connect_on_app_finalize def add_backend_cleanup_task ( app ) : @ app . task ( name = u'celery.backend_cleanup' , shared = False , lazy = False ) def backend_cleanup ( ) : app . backend . cleanup ( ) return backend_cleanup
task used to clean up expired results .