ragflow
ragflow copied to clipboard
Singleton func bugs?
Is there an existing issue for the same bug?
- [X] I have checked the existing issues.
Branch name
main
Commit ID
abc_singleton
Other environment information
No response
Actual behavior
the singleton fuc is :
def singleton(cls, *args, **kw):
instances = {}
def _singleton():
key = str(cls) + str(os.getpid())
if key not in instances:
instances[key] = cls(*args, **kw)
return instances[key]
return _singleton
Expected behavior
I think it'is :
def singleton(cls):
instances = {}
def _singleton(*args, **kw):
key = str(cls) + str(os.getpid())
if key not in instances:
instances[key] = cls(*args, **kw)
return instances[key]
return _singleton
Steps to reproduce
...
Additional information
No response
Sorry, I don't get it. Why don't you submit a pull request?