Exemplo n.º 1
0
 def run(self, configfile):
     conf = self.read_lists_config(configfile)
     updater = Updater(conf)
     
     while True:
         seeds = updater.update_pending_seeds(limit=100)
         if not seeds:
             print >> sys.stderr, time.asctime(), "no pending seeds. sleeping for 2 seconds."
             time.sleep(2)
Exemplo n.º 2
0
def update_lists(changeset):
    """Updates the lists database on edit.
    """
    keys = [x['key'] for x in changeset['docs']]
    set_task_data(keys = keys, changeset = changeset['id'])
    logger.info("BEGIN update_lists: %s", changeset['id'])
    configfile = celeryconfig.OL_CONFIG
    ol_config = formats.load_yaml(open(configfile).read())
    
    updater = ListUpdater(ol_config.get("lists"))
    updater.process_changeset(changeset, update_seeds=False)
    logger.info("END update_lists")
Exemplo n.º 3
0
 def run(self, configfile, offset_file):
     self.offset_file = offset_file
     conf = formats.load_yaml(open(configfile).read())
     updater = Updater(conf.get("lists"))
     
     infobase_log_url = "http://%s/openlibrary.org/log" % conf.get("infobase_server")
     self.read_changesets(infobase_log_url, updater.process_changesets)