I use APScheduler to schedule a job which calls an API every minute. I now get a massive error which ends with:
File "/usr/lib/python2.7/httplib.py", line 1045, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 409, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "/usr/lib/python2.7/socket.py", line 476, in readline
data = self._sock.recv(self._rbufsize)
File "/usr/lib/python2.7/ssl.py", line 341, in recv
return self.read(buflen)
File "/usr/lib/python2.7/ssl.py", line 260, in read
return self._sslobj.read(len)
SSLError: The read operation timed out
WARNING:apscheduler.scheduler:Execution of job "getAndStoreAPICallResult
(trigger: cron[minute='*'], next run at: 2014-07-08 15:37:00)" skipped: maximum
number of running instances reached (1)
So I guess that the API call somehow doesn't get a response and therefore never finishes. This inhibits running the next job, because the first has never ended. Because of this, it somehow cannot start running a new job.
I could of course increase the number of allowed concurrent running instances, but that wouldn't really solve the problem. I guess I need to make the job end if it hasn't finished after a certain number of seconds (lets say 5).
Because I've got a couple other API-call-jobs that I start with APScheduler it would be awesome if I can somehow solve this using APScheduler. Does anybody know if APScheduler makes it possible to terminate too long running jobs, or do I need to solve this in another way?
All tips are welcome!