def sync_debug(): # Just in case the debug value changes during the load of modules if not app.config['DEBUG']: return "Not in debug mode!" now = datetime.datetime.utcnow() t0 = time.time() from appcomposer.translator.translation_listing import synchronize_apps_no_cache, synchronize_apps_cache synchronize_apps_no_cache() tf = time.time() return "<html><body>synchronization process finished (%.2f seconds): %s </body></html>" % (tf - t0, now)
def sync_debug(): # Just in case the debug value changes during the load of modules if not current_app.debug: return "Not in debug mode!" now = datetime.datetime.utcnow() t0 = time.time() from appcomposer.translator.translation_listing import synchronize_apps_no_cache synchronize_apps_no_cache("sync debug") tf = time.time() return "<html><body>synchronization process finished (%.2f seconds): %s </body></html>" % (tf - t0, now)
def synchronize_apps_no_cache_wrapper(self, source = None, single_app_url = None, must_sync = True): if source is None: source = 'scheduled' with my_app.app_context(): result = synchronize_apps_no_cache(source = source, single_app_url = single_app_url) if must_sync: sync(self, False) return result
def synchronize_apps_no_cache_wrapper(self, source = None): if source is None: source = 'scheduled' # synchronize all the apps with my_app.app_context(): result = synchronize_apps_no_cache(source = source) # Call mongodb task_sync_mongodb_all.delay() return result
def synchronize_apps_no_cache_wrapper(self): with my_app.app_context(): result = synchronize_apps_no_cache() sync(self) return result