File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -551,10 +551,11 @@ def commission
551551
552552 def complete_commission
553553 commission = BasilCommission . find_by ( job_id : params [ :jobid ] )
554- return if commission . nil?
555-
556- commission . update ( completed_at : DateTime . current ,
557- final_settings : JSON . parse ( params [ :settings ] ) )
554+ raise "Tried to complete commission with invalid job ID #{ params [ :jobid ] } " if commission . nil?
555+
556+ merged_settings = commission . final_settings || { }
557+ commission . update! ( completed_at : DateTime . current ,
558+ final_settings : merged_settings . merge ( JSON . parse ( params . fetch ( :settings , "{}" ) ) ) )
558559
559560 # Attach the image in S3 to our `image` ActiveStorage relation
560561 key = "job-#{ params [ :jobid ] } .png"
Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ def submit_to_job_queue!
1818
1919 # TODO clean this up and put it in a service
2020 sts_client = Aws ::STS ::Client . new ( region : region )
21- queue_url = 'https://sqs.' + region + '.amazonaws.com/' +
22- sts_client . get_caller_identity . account + '/' + queue_name
21+ queue_url = 'https://sqs.' + region + '.amazonaws.com/' + sts_client . get_caller_identity . account + '/' + queue_name
2322 sqs_client = Aws ::SQS ::Client . new ( region : region )
2423
2524 message_body = {
Original file line number Diff line number Diff line change 293293 <%= commission . prompt %>
294294 </ blockquote >
295295 </ li >
296+ < li >
297+ < small > <%= commission . job_id %> </ small >
298+ </ li >
296299 </ ul >
297300 </ div >
298301 </ div >
You can’t perform that action at this time.
0 commit comments