Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix run_time_to_db() for jobs submitted to remote computers #1067

Merged
merged 2 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyiron_base/jobs/job/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ def run_time_to_db(self):
"""
Internal helper function to store the run_time in the database
"""
if self.job_id is not None:
if not state.database.database_is_disabled and self.job_id is not None:
self.project.db.item_update(self._runtime(), self.job_id)

def _runtime(self):
Expand Down
2 changes: 1 addition & 1 deletion pyiron_base/jobs/job/runfunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def run_job_with_runmode_srun(job):

def run_time_decorator(func):
def wrapper(job):
if job.job_id is not None:
if not state.database.database_is_disabled and job.job_id is not None:
job.project.db.item_update({"timestart": datetime.now()}, job.job_id)
func(job)
job.project.db.item_update(job._runtime(), job.job_id)
Expand Down