New Repeating tasks#868
Conversation
|
oooohhhh I like where this is going! |
|
@diegogangl I'm trying to write unittests along side the new code, but I'm having issues with importing the datastore2. However this does not happen in the dev console. >>> from GTG.core.datastore2 import Datastore2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/zeddo/Documents/github.com/zeddo123/gtg/GTG/core/datastore2.py", line 37, in <module>
import GTG.core.info as info
ModuleNotFoundError: No module named 'GTG.core.info'
>>> |
|
:P I just realized I didn't write any tests for the datastore. The info file has some stuff that is filled in by Meson, so it's not available for tests unless you build (check out try:
# Running the app
import GTG.core.info as info
except ImportError:
# Unit tests
import mock
info = mock.Mock()
info.VERSION = 'v0.6' |
It's more usefull to have the next task id than having the previous occurrence in the cases when we want to rewind the history.
|
@diegogangl From what I have understood from the new core is that we no longer have a requester but a datastore that has a Taskstore. Will the tasks have a "pointer" to the datastore as it was the case with the previous implementation? From the point of view of repeating tasks, I need to get a certain number of tasks to get the history of occurrences. |
hmm, I hadn't considered getting other arbitrary tasks from inside a task. I guess the only solution for now is to pass the taskstore to each task. |
|
There's also another option, which would be to have each task emit a signal when the status changes. Then we can connect the signal of each task to a handler in task store and do the repeating check in there. Don't know about the performance of this though |
If the performance hit isn't catastrophic, this is definitely a better solution. |
(using decorators) when the task is enabled, children of the task will get enabled and inherit their parent's rrules.
Features
Code implementations
Task(....., repeats_on=BOTH))I'll fill this up later