Indicia-Team / warehouse

GNU General Public License v3.0
5 stars 3 forks source link

Notify verifications and comments scheduled plugin inefficiency #441

Closed johnvanbreda closed 2 years ago

johnvanbreda commented 2 years ago

The notify verifications and comments scheduled plugin uses a query that gets all the comment notifications since a provided start time. However, the calling process (application/controllers/scheduled_tasks.php) expects it to process all comment notifications between the provided start time and a maxTime variable, which is set to whatever the timestamp is of the 5000th record after the first record to process. The next time the scheduled tasks are called, it sets the start time to the old maxTime, which means that the notify verifications and comments plugin is unnecessarily doing work on all the records where the timestamp is after maxTime.

Duplicate notifications are not being created due to a left join, but the additional work makes things less efficient.

johnvanbreda commented 2 years ago

Same issue for species_alerts

johnvanbreda commented 2 years ago

Fixed