You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a scenario where I have bree initialized with an array of jobs. The jobs run on intervals. After a period of time, I need to completely remove all these jobs from the array, regardless of whether or not they have "fired". At that point I'll re-populate the jobs with a new array.
I see in the docs / examples there is bree.remove("job_name"). Is is best practice to iterate through the current array of jobs and remove them one by one (using await)? Will this remove jobs that have not yet "fired"?
Then, once all the jobs are removed, I'm assuming the jobs array for the bree service is empty. Then I could add all the new jobs using bree.add([ array_of_new_jobs]), and then call bree.start()?
Is there no concept of bree.destroy() or bree.removeAll()? Am I on the right track for handling this scenario?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I have a scenario where I have bree initialized with an array of jobs. The jobs run on intervals. After a period of time, I need to completely remove all these jobs from the array, regardless of whether or not they have "fired". At that point I'll re-populate the jobs with a new array.
I see in the docs / examples there is
bree.remove("job_name")
. Is is best practice to iterate through the current array of jobs and remove them one by one (using await)? Will this remove jobs that have not yet "fired"?Then, once all the jobs are removed, I'm assuming the jobs array for the bree service is empty. Then I could add all the new jobs using
bree.add([ array_of_new_jobs])
, and then callbree.start()
?Is there no concept of
bree.destroy()
orbree.removeAll()
? Am I on the right track for handling this scenario?Beta Was this translation helpful? Give feedback.
All reactions