def bind_task(): def callback(*args, **kw): logger.info('tasks heart!') gc.collect() ioloop.call_later(60, callback, *args, **kw) ioloop.call_later(0, callback)
def run(): logger.info('run') twitter = TwitterAPI() thread_executor.submit(twitter.run) later = 3600 ioloop.call_later(later, run)
def bind_task(): def callback(): later = 60 * 60 * 12 # 12 hr logger.debug('add new task load_keywords after {}'.format(later)) logger.info('Run task load_keywords') process_executor.submit(load_and_save_post_cnt_and_keywords) ioloop.call_later(later, callback) ioloop.call_later(1, callback)
def run(): logger.info('running...') thread_executor.submit(main) ioloop.call_later(24 * 3600, run)