def tail_logfiles(logs, milestones, interval=60): db = loaddb.connect_db() loaddb.init_listeners(db) cursor = db.cursor() loaddb.support_mysql57(cursor) loaddb.set_active_cursor(cursor) elapsed_time = 0 master = loaddb.create_master_reader() try: while True: try: interval_work(cursor, interval, master) if not interval: break loaddb.run_timers(cursor, elapsed_time) except IOError as e: error("IOError: %s" % e) time.sleep(interval) elapsed_time += interval if crawl_utils.taildb_stop_requested(): info("Exit due to taildb stop request.") break finally: loaddb.set_active_cursor(None) cursor.close() loaddb.cleanup_listeners(db) db.close() info("Bye!")
def cleanup(self, db): cursor = db.cursor() loaddb.support_mysql57(cursor) try: update_player_scores(cursor) finally: cursor.close()
def tail_logfiles(logs, milestones, interval=60): db = loaddb.connect_db() loaddb.init_listeners(db) cursor = db.cursor() loaddb.support_mysql57(cursor) loaddb.set_active_cursor(cursor) elapsed_time = 0 master = loaddb.create_master_reader() try: while True: try: interval_work(cursor, interval, master) if not interval: break loaddb.run_timers(cursor, elapsed_time) except IOError, e: error("IOError: %s" % e) time.sleep(interval) elapsed_time += interval if crawl_utils.taildb_stop_requested(): info("Exit due to taildb stop request.") break finally: loaddb.set_active_cursor(None) cursor.close() loaddb.cleanup_listeners(db) db.close()
def cleanup(self, db): cursor = db.cursor() loaddb.support_mysql57(cursor) try: update_player_scores(cursor) finally: cursor.close()
def cleanup(self, db): cursor = db.cursor() loaddb.support_mysql57(cursor) try: insert_teams(cursor, get_teams(loaddb.CRAWLRC_DIRECTORY_LIST)) update_clan_scores(cursor) finally: cursor.close()
def cleanup(self, db): cursor = db.cursor() loaddb.support_mysql57(cursor) try: insert_teams(cursor, get_teams(loaddb.CRAWLRC_DIRECTORY_LIST)) update_clan_scores(cursor) finally: cursor.close()
#! /usr/bin/env python import loaddb import update_page db = loaddb.connect_db() c = db.cursor() loaddb.support_mysql57(c) try: update_page.index_page(c) finally: db.close()
#! /usr/bin/env python import loaddb import update_page db = loaddb.connect_db() c = db.cursor() loaddb.support_mysql57(c) try: update_page.index_page(c) finally: db.close()