Adding session job log to session client jobs.

This commit is contained in:
Michael Woods
2025-02-16 11:03:49 -05:00
parent a396480bd2
commit 03766b7e13

View File

@@ -103,11 +103,12 @@ def get_job_id(client: Client, bbs_callsign: str, job_id: int, get_data=True) ->
return JobWrapper(response.payload) return JobWrapper(response.payload)
class JobSession: class JobSession:
def __init__(self, client: Client, bbs_callsign: str, default_timeout: int = 300, stutter: int = 1): def __init__(self, client: Client, bbs_callsign: str, default_timeout: int = 300, stutter: int = 2):
self.client = client self.client = client
self.bbs = bbs_callsign self.bbs = bbs_callsign
self.timeout = default_timeout self.timeout = default_timeout
self.stutter = stutter self.stutter = stutter
self.job_log = []
def connect(self) -> PacketServerConnection: def connect(self) -> PacketServerConnection:
return self.client.new_connection(self.bbs) return self.client.new_connection(self.bbs)
@@ -125,6 +126,7 @@ class JobSession:
while not j.is_finished: while not j.is_finished:
time.sleep(self.stutter) time.sleep(self.stutter)
j = self.get_id(jid) j = self.get_id(jid)
self.job_log.append(j)
return j return j