Some work on VesselThread

This commit is contained in:
Kumi 2021-11-25 17:09:40 +01:00
parent 7cfcc99909
commit b6eb599dd0

View file

@ -5,9 +5,11 @@ from classes.vessel import Vessel
import time import time
class VesselThread(Process): class VesselThread(Process):
"""Thread processing uploads to a single vessel """Thread processing uploads to a single vessel
""" """
def __init__(self, vessel: Vessel, state: dict) -> None: def __init__(self, vessel: Vessel, state: dict) -> None:
"""Initialize a new VesselThread """Initialize a new VesselThread
@ -25,7 +27,13 @@ class VesselThread(Process):
print("Launched Vessel Thread for " + self.vessel.name) print("Launched Vessel Thread for " + self.vessel.name)
while True: while True:
try: try:
print(self._state["files"][0]) self.processQueue()
except: except Exception as e:
print("An exception occurred in the Vessel Thread for " +
self.vessel.name)
print(repr(e))
def processQueue(self) -> None:
for f in self._state["files"]:
if not f.uuid in self.vessel._uploaded:
pass pass
time.sleep(1)