This commit is contained in:
Oleg Sheynin
2026-01-12 21:26:15 +00:00
parent bd6cf1d4d0
commit c0fabcb429
15 changed files with 1205 additions and 568 deletions
+4 -1
View File
@@ -151,6 +151,7 @@ class MdSummaryCollector(NamedObject):
return MdSummary.from_REST_response(response=response)
def get_last(self) -> Optional[MdSummary]:
Log.info(f"{self.fname()}: for {self.exch_inst_.details_short()}")
rqst_data = self.rqst_data()
rqst_data["history_depth_sec"] = self.interval_sec_ * 2
response: requests.Response = self.sender_.send_post(
@@ -186,10 +187,12 @@ class MdSummaryCollector(NamedObject):
def set_timer(self):
if self.timer_:
self.timer_.cancel()
start_in = self.next_load_time() - current_seconds()
self.timer_ = Timer(
start_in_sec=(self.next_load_time() - current_seconds()),
start_in_sec=start_in,
func=self._load_new,
)
Log.info(f"{self.fname()} Timer for {self.exch_inst_.details_short()} is set to run in {start_in} sec")
def next_load_time(self) -> NanosT:
curr_sec = int(current_seconds())