I have one sudo code here, using delayedjob with rails, actually tired but in some cases it getting weird, i want to call the first delay and after that is finished, then only start second delay, so i have used the priority. Is this the proper way to do this or is anything wrong?
class Core def foo priority = 0 if condition1 if condition2 self.delay(priority: priority).foo1(priority) end self.delay(priority: priority).foo1(priority) end end def foo1(priority) if condition1 if condition2 priority +=1 self.delay(priority: priority).foo1(priority) end priority +=1 self.delay(priority: priority).foo1(priority) end end end
No comments:
Post a Comment