Skip to content

Commit

Permalink
possibly better
Browse files Browse the repository at this point in the history
  • Loading branch information
sean committed Oct 4, 2024
1 parent 91f6219 commit 3506e26
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions helpers/cudo_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def worker(self):
print(f"Error creating VM: {e}")

self.task_queue.task_done()
print("Task done")

def start_queue(self):
if not self.task_queue:
Expand All @@ -165,16 +164,15 @@ def start_workers(self):
self.executor.submit(self.worker)

def stop_workers(self):
print("stop workers")
# if not self.shutdown_event.is_set():
# try:
# self.workers_active = False
# self.shutdown_event.set()
#
# self.executor.shutdown(wait=False)
#
# except Exception as e:
# print(f"Error shutting down: {e}")
if not self.shutdown_event.is_set():
try:
self.workers_active = False
self.shutdown_event.set()

self.executor.shutdown(wait=False)

except Exception as e:
print(f"Error shutting down: {e}")



Expand Down

0 comments on commit 3506e26

Please sign in to comment.