1. Peter Sanchez
  2. django-callback
  3. Issues
Issue #1 new

Use statuses instead of "is_active"

Peter Sanchez
repo owner created an issue

Need to switch to use statuses instead of the is_active boolean.

Since callbacks are generally run via crontab there has been some reports longer running tasks are lasting past the cronjob period. ie, every 5 minutes the run_callbacks command is issued. When a task takes longer than the 5 minute period, it's re-run as it has yet to be deactivated. This creates an ugly domino effect.

We can use simple statuses to avoid this. Proposed statuses are.

  1. active - Waiting to be processed
  2. pending - In process queue, waiting to actually start processing
  3. processing - Actually in process
  4. complete - Successfully completed
  5. failed - Processing failed.

The manager will need updating for the global features. The management command will need to update all currently gathered active callbacks to pending. The callback_manager will need to set a callback to processing once processing starts. The mark_success and mark_error model helper methods will need to be updated.

Last, we'll also need some south migrations for the new status field, but also a data migration to migrate any callbacks in the database to the new format. Not pretty, but necessary.

Comments (0)

  1. Log in to comment