Eddiebot: Re-schedule jobs created by the reminder command if node process goes down

Created on 18 Jul 2020  路  7Comments  路  Source: EddieJaoudeCommunity/EddieBot

Problem

The user can create a reminder for the next day, but if the node process goes down (this happens frequently), the reminder message won't be sent.

Proposed Solution

store in the DB and load from the DB, because the node instance could be replace with another or load balanced for example.
(from this PR)

Tasks

  • [ ] New collection called jobs that have a id, reminderMessage, status with the possible values: "scheduled", "running", "finished", "error", and an optional name.
  • [ ] At startup time (index.ts), read from the jobs collection to reschedule the jobs that are in an error state
  • [ ] Gracefully shutdown and save the jobs on the DB, these jobs could be in memory until the process shutsdown, for example an array of these objects that gets a new entry on the reminder command. We could catch the process shutdown like this:
process.on('SIGTERM', () => {
  console.info('SIGTERM signal received.');
  //...
});
enhancement

All 7 comments

I don't see it as a bug, I see it as an improvement 馃

Stale issue message

Stale bot we probably still need this one 馃

@eddiejaoude we probably need to reconfigure the stale bot. He is ignoring your comment to say there is activity 馃槄

Why stalebot, why!? 馃槀

Stale issue message

I think when I remove the label, stalebot behaves.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eddiejaoude picture eddiejaoude  路  5Comments

RaisinTen picture RaisinTen  路  6Comments

RaisinTen picture RaisinTen  路  3Comments

mikeysan picture mikeysan  路  5Comments

eddiejaoude picture eddiejaoude  路  4Comments