diff --git a/ampel/nuclear/t3/T3PlotNeoWISE.py b/ampel/nuclear/t3/T3PlotNeoWISE.py index 472fb80..95c9545 100755 --- a/ampel/nuclear/t3/T3PlotNeoWISE.py +++ b/ampel/nuclear/t3/T3PlotNeoWISE.py @@ -530,7 +530,7 @@ def process( plot_fname = f"{filebase}-neoWISE.pdf" buf = io.BytesIO() - ax.figure.savefig(buf, format="pdf") + fig.savefig(buf, format="pdf") buf.seek(0) self.put(plot_fname, buf.read()) self.logger.debug(f"plotting {tran_name}") diff --git a/ampel/nuclear/t3/dropboxIO.py b/ampel/nuclear/t3/dropboxIO.py index 6503890..77a0ab8 100644 --- a/ampel/nuclear/t3/dropboxIO.py +++ b/ampel/nuclear/t3/dropboxIO.py @@ -165,10 +165,10 @@ def put(self, path, payload): def maybe_commit(self) -> None: if sum(size for _, _, size in self._payloads) >= self.buffer_size_mb * (1<<20): - return self.commit() + self.commit() @backoff.on_predicate(backoff.expo, factor=10, max_tries=5) - def commit(self) -> bool: + def commit(self) -> None: # Dropbox cannot handle queues containing more than 1000 files payload_subsets = [ @@ -228,7 +228,7 @@ def commit(self) -> bool: if result.is_failure(): self._payloads.append(item) self.logger.error(f"{result.get_failure()} for {item[1]}") - return len(self._payloads) == 0 + return @lru_cache(maxsize=1024) @handle_disconnects