RealOrangeOne / django-tasks

A reference implementation and backport of background workers and tasks in Django
https://pypi.org/project/django-tasks/
BSD 3-Clause "New" or "Revised" License
211 stars 13 forks source link

Adding completion datetimes to the TaskResults (#31) #49

Closed dennisstritzke closed 3 weeks ago

dennisstritzke commented 3 weeks ago

Find below a couple of things I would like to highlight (numbers for easier reference only):

  1. I introduced the enqueued_at field as required and setting it to timezone.now() during the migration. As this only causes wrong enqueue times and we'll most likely squash migration pre-v1, I see no issues with that. Anything wrong with that reasoning?
  2. I set the finished_at time of the DummyBackend to None. It is the intended behaviour of the DummyBackend to accept tasks, but not complete them by itself, correct?
  3. Do you think we should add a test for the TaskResult.(a)refresh methods through this PR, which asserts that the status, finished_at and result returned by the backend are actually used to update the TaskResult? That tests seems rather elaborate, while providing only little value. What do you think?