Skip to content

Commit

Permalink
Add setting for default heartbeat interval (#914)
Browse files Browse the repository at this point in the history
  • Loading branch information
thequilo committed May 2, 2023
1 parent 0a7320a commit d668b53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Here is a brief list of all currently available options.

* ``CAPTURE_MODE`` *(default: 'fd' (linux/osx) or 'sys' (windows))*
configure how stdout/stderr are captured. ['no', 'sys', 'fd']

* ``DEFAULT_BEAT_INTERVAL`` *(default: 10.0)* Configures the default beat interval
* ``CONFIG``

* ``ENFORCE_KEYS_MONGO_COMPATIBLE`` *(default: True)*
Expand Down
4 changes: 2 additions & 2 deletions sacred/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
import traceback as tb

from sacred import metrics_logger
from sacred import metrics_logger, SETTINGS
from sacred.metrics_logger import linearize_metrics
from sacred.randomness import set_global_seed
from sacred.utils import SacredInterrupt, join_paths, IntervalTimer
Expand Down Expand Up @@ -91,7 +91,7 @@ def __init__(
self.meta_info = {}
"""A custom comment for this run"""

self.beat_interval = 10.0 # sec
self.beat_interval = SETTINGS.DEFAULT_BEAT_INTERVAL # sec
"""The time between two heartbeat events measured in seconds"""

self.unobserved = False
Expand Down
2 changes: 2 additions & 0 deletions sacred/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def __deepcopy__(self, memodict=None):
"DISCOVER_DEPENDENCIES": "imported",
# configure how source-files are discovered. [none, imported, sys, dir]
"DISCOVER_SOURCES": "imported",
# Configure the default beat interval, in seconds
"DEFAULT_BEAT_INTERVAL": 10.0,
},
)
SETTINGS.freeze_keys()

0 comments on commit d668b53

Please sign in to comment.