File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
app/models/services/bling Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,10 @@ def find_orders
47
47
break if ( page . eql? ( 2 ) && Rails . env . eql? ( 'test' ) )
48
48
49
49
response = HTTParty . get ( base_url , query : params . merge ( pagina : page ) , headers :)
50
-
51
- raise "Error: #{ response . code } - #{ response . message } " unless response . success?
50
+ if response . code . eql? ( 429 )
51
+ sleep 5
52
+ response = HTTParty . get ( base_url , query : params . merge ( pagina : page ) , headers :)
53
+ end
52
54
53
55
data = JSON . parse ( response . body )
54
56
break if data [ 'data' ] . blank?
Original file line number Diff line number Diff line change 101
101
description : "Create Order Items with pending status on the week"
102
102
} ,
103
103
104
+ general_pending_order_items_task : {
105
+ cron : "@monthly" ,
106
+ class : "PendingOrderItemsJob" ,
107
+ args : [ 1 ] ,
108
+ set : { priority : 3 } ,
109
+ description : "Create Order Items with pending status considering all period"
110
+ } ,
111
+
104
112
printed_order_items_task : { # each recurring job must have a unique key
105
113
cron : "*/1 * * * *" , # cron-style scheduling format by fugit gem
106
114
class : "PrintedOrderItemsJob" , # name of the job class as a String; must reference an Active Job job class
Original file line number Diff line number Diff line change 126
126
description : "Create Order Items with pending status on the week"
127
127
} ,
128
128
129
+ general_pending_order_items_task : {
130
+ cron : "@monthly" ,
131
+ class : "PendingOrderItemsJob" ,
132
+ args : [ 1 ] ,
133
+ set : { priority : 3 } ,
134
+ description : "Create Order Items with pending status considering all period"
135
+ } ,
136
+
129
137
printed_order_items_task : { # each recurring job must have a unique key
130
138
cron : "*/1 * * * *" , # cron-style scheduling format by fugit gem
131
139
class : "PrintedOrderItemsJob" , # name of the job class as a String; must reference an Active Job job class
You can’t perform that action at this time.
0 commit comments