woocommerce / action-scheduler-custom-tables

This plugin is no longer needed. The custom table code is now part of Action Scheduler version 3.0 and newer. If you're using the latest Action Scheduler, you have the most performant schema available.
https://actionscheduler.org
14 stars 2 forks source link

last_attempt dates not being set correctly for migrated completed actions #10

Closed thenbrent closed 6 years ago

thenbrent commented 6 years ago

The last_attempt_local and last_attempt_gmt values are being set to 0000-00-00 00:00:00 when migrating a completed action. They should instead be set to the post_modified and post_modified_gmt column values for the action being migrated.

This ultimately leads to all completed actions being deleted soon after migrating, because ActionScheduler_QueueCleaner::delete_old_actions() runs a query to find actions with a modified <= 31 days ago, which 0000-00-00 00:00:00 will always be.