Skip to content

Commit

Permalink
fix(transfer daemon): Updated transfer daemon to work with results
Browse files Browse the repository at this point in the history
  • Loading branch information
pscholz committed Apr 28, 2022
1 parent 222d73d commit d7ee97e
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions chime_frb_api/workflow/daemons/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,17 @@ def transfer_work(limit_per_run=1000):
buckets = Buckets()
results = Results()

# do we need to deposit results per pipeline? Assuming so for now.
pipelines = buckets.pipelines()
successful_work = buckets.view(
query = {"status": "success"},
projection = {}, # do we want everything?
skip = 0,
limit = limit_per_run,
)

for pipeline in pipelines:

successful_work = buckets.view(
query = {"status": "success", "pipeline": pipeline},
projection = {}, # do we want everything?
skip = 0,
limit = limit_per_run,
)

if len(successful_work):
status = results.deposit(successful_work, pipeline=pipeline)
if status ==True: # is this enough to confirm its deposited?
buckets.delete_ids([work.id for work in successful_work])
if len(successful_work):
status = results.deposit(successful_work)
if status == True: # is this enough to confirm its deposited?
buckets.delete_ids([work.id for work in successful_work])

if __name__ == "__main__":
transfer_work()
Expand Down

0 comments on commit d7ee97e

Please sign in to comment.