Skip to content
Advertisement

Python: Run a code after return something

This is an ApiView from my django project:

JavaScript

As you see, if client.is_busy is not True, I’m making it True in here. But in this situation, I need to client.is_busy = False after 30 seconds. If I do it under client.save() code, it delays to response. How can I do it?

Advertisement

Answer

You should consider using timer objects here.

e.g.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement