#4783 (Replace schedule by tasks in database)
by Luc Saffre · in Developers · assigned to Sharif Mehedi
Summary
New model system.Task to replace schedule. Example of new tasks : every week send an email to every worker, (a) asking them to confirm their calendar antries of the coming week, and/or (b) an overview of what they did during the week (work sessions, some stats about their activity like the number of comments written, ...)
Children
Comments
- 3 years, 6 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : There was a timebomb in Sharif's changes: the translations of the code that was moved from xl to lino. They "disappeared" after I had run "inv mm" in xl. I am now copying the German translations manually to lino. There is a trick for not doing it manually (via poedit) : open both po files in text ed...
- 3 years, 6 months ago by Luc Saffre in reply to Luc Saffre about #4783 (Replace schedule by tasks in database) : Works.
- 3 years, 6 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) (1 reply) : Testing whether this comment is notified by email to everybody. (I checked "Notify myself" in my user settings before writing this comment).
- 3 years, 6 months ago by Sharif Mehedi about #4783 (Replace schedule by tasks in database) (1 reply) : Hey this is wrong. The linod worker insert and update the tasks into the database on each restart. We don't need to worry about that.
- 3 years, 6 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : This will fix the issue because the [url hosting.lino-framework.org/upgrade/ instructions for upgrading a production site] include running "pm checkdata -f".
- 3 years, 6 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : To fix this, i suggest to write a data checker that checks whether there is (at least one) a system.Task row for every Procedure. Maybe we need a new choice "never" in Recurrencies.
- 3 years, 6 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : There's something missing. If we would upgrade Jane now, we would de facto have all background tasks deactivated, including the sending of notifications, because the system.Task table would be empty.
- 3 years, 6 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : I am seeing a failure in book/lino_book/projects/noi1e/tests/test_system_tasks.py at least on my machine. Please have a look at it on your machine as well: "go noi1e ; pm test".
- 3 years, 6 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : I reviewed the commits in lino and book. Good work! Special congrats for starting to use the walrus operator (":=") when it makes sense.
- 3 years, 6 months ago by Sharif Mehedi about #4783 (Replace schedule by tasks in database) : I pushed to quite some repositories. please do "pp git pull". I am putting this ticket to "ready" status. @luc , please review my work and feel free to close this ticket after.
- 3 years, 6 months ago by Luc Saffre in reply to Luc Saffre about #4783 (Replace schedule by tasks in database) : Not a new class "JobRunner", but simply a BaseRequest. The background functions should use ar.info(), ar.warning() an ar.debug() to report what they do. When the job has finished, store ar.info_message or ar.warning_message or ar.debug_message into a TextField on the Job model. Add a field JobRule.l...
- 3 years, 6 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) (1 reply) : A volatile JobRunner object passed to the function...
- 3 years, 6 months ago by Luc Saffre in reply to Sharif Mehedi about #4783 (Replace schedule by tasks in database) : Go for it. I have pushed all my changes in the book.
- 3 years, 6 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : Move it to lino.modlib.system then?
- 3 years, 6 months ago by Sharif Mehedi about #4783 (Replace schedule by tasks in database) : I tried to move the RecurrenceSet from cal.mixins to lino.mixins.periods but retained from doing it because it has dependencies to cal.choicelists.Recurrencies (not sure if moving a ChoiceList into mixins is a good idea).
- 3 years, 6 months ago by Sharif Mehedi about #4783 (Replace schedule by tasks in database) (1 reply) : I am done working on this except that the test suite need adjustment for there are new data views and actions.
- 3 years, 6 months ago by Sharif Mehedi about #4783 (Replace schedule by tasks in database) (1 reply) : I am thinking if I should start working on this.
- 3 years, 7 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : I wrote down [url luc.lino-framework.org/blog/2023/0322.html my current plan].
- 3 years, 7 months ago by Luc Saffre in reply to Luc Saffre about #4783 (Replace schedule by tasks in database) : No, the cms is even more important than the warehouse. I'll work on #4742 not on #4551
- 3 years, 7 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) (1 reply) : No, i let this ticket wait because it's an invisible feature, i will rather start #4551 because that's something visible.
- 3 years, 7 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : You will need to move RecurrenceSet from lino_xl.lib.cal to lino.mixins.periods
- 3 years, 9 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : In the system plugin. And right now I'd say "Task" for the model and "Procedure" for the choicelist. Plugins would say "system.register_procedure()" (similar to "ledger.register_vouchertype()". And the current occurences of dd.schedule_often get replaced by a "yield system.Task()" in a std fixture.
- 3 years, 9 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : More precisely we need one choicelist where any plugin can register "tasks", and a database model where the site admin configures whether and when they want a task to run. Not yet sure where to put this: into the system plugin? Or a plugin on its own?
- 3 years, 9 months ago by Luc Saffre about #4783 (Replace schedule by tasks in database) : Created new Ticket #4783 (⚹ Replace schedule by tasks in database).