def do_acc(pid, job): parsed = parse_pid(pid) lid = parsed[LID] ts_label = parsed[TS_LABEL] roots = get_data_roots(session, ts_label) # get raw data roots fileset = parsed_pid2fileset(parsed, roots) fileset[LID] = lid session.expire_all() # don't be stale! acc = Accession(session,ts_label)#,fast=True) # FIXME fast=True disables checksumming client.update(pid,ttl=3600) # allow 1hr for accession ret = acc.add_fileset(fileset) if ret=='ADDED': schedule_products(pid, client) session.commit() client.wakeup() elif ret=='FAILED': raise Exception('accession failed')
def get_data_roots(ts_label, product_type='raw'): return files.get_data_roots(session, ts_label, product_type)