MatthiasKNU
Resource contributor
- Messages
- 962
- Country

Hello everyone!
This time I need a little bit of special help - while programming my scripts.
First the affected part:
The problem is the following:
The function call in line 773 *might* take forever due to a small problem in a called module when the roads-shapefile is to big.
So i would like to start a timer, limited to i.e. 300 seconds. After these 300 seconds have passed, the script should go to the "except TimeoutError"-Part.
Then I can handle the problem, and re-run it.
Now I am running this script on windows and Python 2.7, so something like that
... won't work.
I also tried it already with calling the multiprocessing-module, but it also doesn't really work.
Does anyone of you know, how I can add a timeout to the function call in line 773, which actively cancels the function calls inside ther erase_buffer_roads-function?
I kow, that this is a very special question, but maybe someone can help me!
Thanks in advance!
This time I need a little bit of special help - while programming my scripts.
First the affected part:
The problem is the following:
The function call in line 773 *might* take forever due to a small problem in a called module when the roads-shapefile is to big.
So i would like to start a timer, limited to i.e. 300 seconds. After these 300 seconds have passed, the script should go to the "except TimeoutError"-Part.
Then I can handle the problem, and re-run it.
Now I am running this script on windows and Python 2.7, so something like that
Code:
signal.signal(signal.SIGALRM, handler)
I also tried it already with calling the multiprocessing-module, but it also doesn't really work.
Does anyone of you know, how I can add a timeout to the function call in line 773, which actively cancels the function calls inside ther erase_buffer_roads-function?
I kow, that this is a very special question, but maybe someone can help me!
Thanks in advance!