1

I have a script that I'm building an interface for so people can execute after uploading a CSV file. Is there a way to call a command using:

management.call_command()

But then stop the running script programatically? This would be if the script takes too long.

Any help is much appreciated.

Zee

zee
  • 656
  • 2
  • 7
  • 30
  • possible duplicate of [Timeout on a Python function call](http://stackoverflow.com/questions/492519/timeout-on-a-python-function-call) – Jacinda Oct 11 '14 at 15:43
  • I should probably clarify. What I meant was is there a way to stop the script manually? Not necessarily through a timeout. – zee Oct 18 '14 at 21:17

1 Answers1

1

Take a look at this answer https://stackoverflow.com/a/2282656/3951758. Also you can use cron to kill any process at certain time.

Community
  • 1
  • 1
byashimov
  • 454
  • 2
  • 6