HackerExperience / Helix

GNU Affero General Public License v3.0
53 stars 10 forks source link

Persist next-to-be-completed processes on disk (DB) #325

Open renatomassaro opened 6 years ago

renatomassaro commented 6 years ago

Current TOP wakes itself once a process is about to be completed. This happens by sending itself a message as soon as the process is completed (based on Schedule.forecast/1).

This works fine but has a big problem:

While it's possible to handle most cases gracefully, it doesn't hurt to persist the process on disk. Every time the VM boots, it should look for all processes which are/were being tracked. If any of these has expired their estimated time (i.e. they are completed), then it should call TOPAction.complete/1. For all other processes which are still running, it should use the standard TOPBringMeToLifeEvent.

The implementation of this persistence layer was removed from #322 and delegated to another PR.