personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'hopper-k4fhivp7-observer-clean-exit'

+11 -26
+11 -26
observe/linux/observer.py
··· 297 297 if (draft_path / f).is_file() 298 298 ] 299 299 uploaded = False 300 - if draft_files and self._client: 300 + if draft_files and self._client and self.running: 301 301 meta = {"host": HOST, "platform": PLATFORM, "stream": self.stream} 302 - result = self._client.upload_segment( 303 - date_part, segment_key, draft_files, meta 302 + result = await asyncio.to_thread( 303 + self._client.upload_segment, 304 + date_part, 305 + segment_key, 306 + draft_files, 307 + meta, 304 308 ) 305 309 if result.success: 306 310 logger.info( ··· 572 576 segment_key = f"{time_part}_{duration}" 573 577 574 578 if self.draft_dir and files: 575 - draft_path = Path(self.draft_dir) 576 - draft_files = [ 577 - draft_path / f 578 - for f in os.listdir(self.draft_dir) 579 - if (draft_path / f).is_file() 580 - ] 581 - uploaded = False 582 - if draft_files and self._client: 583 - meta = {"host": HOST, "platform": PLATFORM, "stream": self.stream} 584 - result = self._client.upload_segment( 585 - date_part, segment_key, draft_files, meta 586 - ) 587 - if result.success: 588 - logger.info( 589 - f"Final segment uploaded: {segment_key} ({len(draft_files)} files)" 590 - ) 591 - uploaded = True 592 - else: 593 - logger.error(f"Final segment upload failed: {segment_key}") 594 - if uploaded: 595 - cleanup_draft(self.draft_dir) 596 - else: 597 - finalize_draft(self.draft_dir, segment_key) 579 + finalize_draft(self.draft_dir, segment_key) 580 + logger.info( 581 + f"Finalized segment locally: {segment_key} (shutdown, skipping upload)" 582 + ) 598 583 elif self.draft_dir: 599 584 cleanup_draft(self.draft_dir) 600 585