If a scan task is pending when its associated scan is deleted, the queuing system will freeze and prevent other scans from running.
To reproduce
As a Global User, navigate to the scans pages and create a scan.
Click the run button several times and delete the scan.
Create a new scan and click the run button.
Confirm that the new scan doesn't run.
You may also look at the scan_task table to confirm that the old scan tasks have a pending status.
Expected behavior
I suggest we add logic to the scheduler to mark the orphaned scan tasks as finished and/or delete them.
🐛 Summary
If a scan task is pending when its associated scan is deleted, the queuing system will freeze and prevent other scans from running.
To reproduce
As a Global User, navigate to the scans pages and create a scan. Click the run button several times and delete the scan. Create a new scan and click the run button. Confirm that the new scan doesn't run. You may also look at the scan_task table to confirm that the old scan tasks have a pending status.
Expected behavior
I suggest we add logic to the scheduler to mark the orphaned scan tasks as finished and/or delete them.