I'm writing an API in Django to store support tickets in a database. This consists of an Error ID, email address, phone number, image file of the problem, and the date/time the entry was submitted.
Due to the nature of the use case here, I need to poll the API every 10 minutes or so with a request to check on the status of all tickets. What I want to do is automatically delete every ticket that is unresolved for over 10 minutes (not immediately delete on 10 minutes, but when the API is polled and finds that the entry is over 10 minutes old).
I thought that including the date/time column would help me but I can't think of any way of doing the check that isn't super messy. The data type is models.DateTimeField and the database I'm using is MariaDB.