I've recently been struggling with MailWizz campaigns being stuck at processing due to a restart in my MySQL database. The restart caused MailWizz PCNTL processes to be killed (lose connection) with the campaigns still being at the 'processing' stage; hence, when the send command is run again, it does not process these campaigns because it thinks they are already in the processing stage.
I have a suggestion on how to improve this -- keep track of PIDs. Whenever the send campaign command starts processing a campaign, it records the PID of the process in a temporary MailWizz table in association with the campaign UID (and removes the PID when a campaign leaves processing stage). Every time send campaign command is run, MailWizz checks the associated PIDs for all campaigns in the processing stage. If the PIDs in the temp table are not running, that means the campaign is stuck at processing and can be reverted to sending status and reprocessed. If the PIDs in the temp table are running, MailWizz would need to confirm the PID is currently associated with a MailWizz send campaign command (because PIDs can be reused); if it is, then the campaign is still being processed. If not, then the campaign is stuck.
What do you all think?
I have a suggestion on how to improve this -- keep track of PIDs. Whenever the send campaign command starts processing a campaign, it records the PID of the process in a temporary MailWizz table in association with the campaign UID (and removes the PID when a campaign leaves processing stage). Every time send campaign command is run, MailWizz checks the associated PIDs for all campaigns in the processing stage. If the PIDs in the temp table are not running, that means the campaign is stuck at processing and can be reverted to sending status and reprocessed. If the PIDs in the temp table are running, MailWizz would need to confirm the PID is currently associated with a MailWizz send campaign command (because PIDs can be reused); if it is, then the campaign is still being processed. If not, then the campaign is stuck.
What do you all think?