Noparallel ignore args add first parameter to make it per-class
This commit is contained in:
parent
6c74f6c527
commit
b220f5de5c
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ class Noparallel(object): # Only allow function running once in same time
|
||||||
def __call__(self, func):
|
def __call__(self, func):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
if self.ignore_args:
|
if self.ignore_args:
|
||||||
key = func # Unique key only by function
|
key = (func, args[0]) # Unique key only by function and class object
|
||||||
else:
|
else:
|
||||||
key = (func, tuple(args), str(kwargs)) # Unique key for function including parameters
|
key = (func, tuple(args), str(kwargs)) # Unique key for function including parameters
|
||||||
if key in self.threads: # Thread already running (if using blocking mode)
|
if key in self.threads: # Thread already running (if using blocking mode)
|
||||||
|
|
Loading…
Reference in a new issue