mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-06-25 20:20:53 +02:00
Update dvmtaskinterface.py
This commit is contained in:
parent
47c842fa90
commit
9626c08201
@ -38,7 +38,7 @@ class DVMTaskInterface:
|
|||||||
def __init__(self, name, dvm_config: DVMConfig, nip89config: NIP89Config, nip88config: NIP88Config = None,
|
def __init__(self, name, dvm_config: DVMConfig, nip89config: NIP89Config, nip88config: NIP88Config = None,
|
||||||
admin_config: AdminConfig = None,
|
admin_config: AdminConfig = None,
|
||||||
options=None, task=None):
|
options=None, task=None):
|
||||||
self.stop_threads = False
|
self.stop_thread = False
|
||||||
self.nostr_dvm_thread = None
|
self.nostr_dvm_thread = None
|
||||||
if options is None:
|
if options is None:
|
||||||
self.options = {}
|
self.options = {}
|
||||||
@ -112,17 +112,17 @@ class DVMTaskInterface:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
stop_threads = False
|
self.stop_thread = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.nostr_dvm_thread = Thread(target=self.DVM, args=[self.dvm_config, self.admin_config, lambda: stop_threads], daemon=False)
|
self.nostr_dvm_thread = Thread(target=self.DVM, args=[self.dvm_config, self.admin_config, lambda: self.stop_thread], daemon=False)
|
||||||
self.nostr_dvm_thread.start()
|
self.nostr_dvm_thread.start()
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
print("gone")
|
print("gone")
|
||||||
|
|
||||||
|
|
||||||
def join(self):
|
def join(self):
|
||||||
self.stop_threads = True
|
self.stop_thread = True
|
||||||
self.nostr_dvm_thread.join(1)
|
self.nostr_dvm_thread.join(1)
|
||||||
dvm_shutdown(self.dvm_config)
|
dvm_shutdown(self.dvm_config)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user