return env
if reqlimit != 0:
- guard = ashd.serve.calllimiter(reqlimit).call
+ guard = ashd.serve.abortlimiter(reqlimit).call
else:
guard = lambda fun: fun()
-import threading, time, logging
+import os, threading, time, logging
log = logging.getLogger("ashd.serve")
seq = 1
return target()
finally:
self.__exit__()
+
+class abortlimiter(calllimiter):
+ def waited(self, time):
+ if time > 10:
+ os.abort()
return env
if reqlimit != 0:
- guard = ashd.serve.calllimiter(reqlimit).call
+ guard = ashd.serve.abortlimiter(reqlimit).call
else:
guard = lambda fun: fun()
-import threading, time, logging
+import os, threading, time, logging
log = logging.getLogger("ashd.serve")
seq = 1
def call(self, target):
with self:
return target()
+
+class abortlimiter(calllimiter):
+ def waited(self, time):
+ if time > 10:
+ os.abort()