Пример #1
0
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)
Пример #2
0
    def run():
        logger.info('run')
        twitter = TwitterAPI()
        thread_executor.submit(twitter.run)

        later = 3600
        ioloop.call_later(later, run)
Пример #3
0
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)
Пример #4
0
 def run():
     logger.info('running...')
     thread_executor.submit(main)
     ioloop.call_later(24 * 3600, run)