Skip to content

Commit

Permalink
Merge pull request #1101 from simonsobs/update_obsdb_recency_edit
Browse files Browse the repository at this point in the history
update_obsdb uses book edit time instead of book_id for recency check
  • Loading branch information
AERAdler authored Jan 21, 2025
2 parents 2347d2d + bc1f2d9 commit 6deb415
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sotodlib/site_pipeline/update_obsdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def main(config: str,
if book_id in config_dict["known_bad_books"]:
logger.debug(f"{book_id} known to be bad, skipping it")
continue
found_timestamp = re.search(r"\d{10}", book_id)#Find the rough timestamp
if found_timestamp and int(found_timestamp.group())>tback:
#Looks like a book folder and young enough
edit_time = os.path.getmtime(dirpath)
if edit_time > tback:
#Looks like a book folder and edited recently enough
bookcart.append(dirpath)

logger.info(f"Found {len(bookcart)} new books in {time.time()-tnow} s")
Expand Down

0 comments on commit 6deb415

Please sign in to comment.