From a31171ba53286ba8d683e1ee1fc481697fb06c4c Mon Sep 17 00:00:00 2001 From: Benjamin Pritchard Date: Thu, 6 Jun 2024 09:30:25 -0400 Subject: [PATCH] Write records to cache immediately --- qcportal/qcportal/cache.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qcportal/qcportal/cache.py b/qcportal/qcportal/cache.py index 21857c1e0..be8041135 100644 --- a/qcportal/qcportal/cache.py +++ b/qcportal/qcportal/cache.py @@ -654,11 +654,12 @@ class functions of the record types. recs = client._fetch_records(record_type, list(records_tofetch), include=include) - # Set up for the writeback + # Set up for the writeback on change, but write the record as-is for now + if record_cache is not None: + record_cache.update_records(recs) for r in recs: - # Don't write to the cache yet. Let the writeback mechanism handle it r._record_cache = record_cache - r._cache_dirty = True + r._cache_dirty = False existing_records += recs