X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Futil%2Fcallids.py;fp=sfa%2Futil%2Fcallids.py;h=904c42b48b5b9fae8aba51e4608415adbdd59e43;hb=c1e0709e40d680d74501adde6728fef906f384bc;hp=23e0c534939b9d62e4d49b7c436a563fb44f5d0f;hpb=74e2ca78d55a9b65eef8f2c156a4ad0794b92ecc;p=sfa.git diff --git a/sfa/util/callids.py b/sfa/util/callids.py index 23e0c534..904c42b4 100644 --- a/sfa/util/callids.py +++ b/sfa/util/callids.py @@ -28,9 +28,9 @@ class _call_ids_impl (dict): # the only primitive # return True if the callid is unknown, False otherwise - def should_handle_call_id (self,call_id): + def already_handled (self,call_id): # if not provided in the call... - if not call_id: return True + if not call_id: return False has_lock=False for attempt in range(_call_ids_impl.retries): if debug: sfa_logger().debug("Waiting for lock (%d)"%attempt) @@ -42,17 +42,17 @@ class _call_ids_impl (dict): # in the unlikely event where we can't get the lock if not has_lock: sfa_logger().warning("_call_ids_impl.should_handle_call_id: could not acquire lock") - return True + return False # we're good to go if self.has_key(call_id): self._purge() self._lock.release() - return False + return True self[call_id]=time.time() self._purge() self._lock.release() if debug: sfa_logger().debug("released lock") - return True + return False def _purge(self): now=time.time()