[Fixed]-Optimize displaying results with django-haystack RealTimeSignalProcessor

1👍

There is no need to keep updating a expires_in field in your database – keep an expires_at with the time when the ad expires, and calculate the time left in your retrieval method in your model or in your view.

This way you’ll avoid having to write more data to your database as traffic increases, and if the expiry date changes you won’t run into a possible race condition if people are viewing the page at the same time while you’re updating the expiry time.

Leave a comment