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

Improve compatibility and precision of date information in log filenames #174

Merged
merged 3 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 src/plotman/_tests/job_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def update_from_logfile(self):

@pytest.fixture(name='logfile_path')
def logfile_fixture(tmp_path):
log_name = '2021-04-04-19:00:47.log'
log_name = '2021-04-04T19_00_47.681088-0400.log'
log_contents = importlib.resources.read_binary(resources, log_name)
log_file_path = tmp_path.joinpath(log_name)
log_file_path.write_bytes(log_contents)
Expand Down
3 changes: 2 additions & 1 deletion src/plotman/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import time
from datetime import datetime

import pendulum
import psutil

# Plotman libraries
Expand Down Expand Up @@ -101,7 +102,7 @@ def maybe_start_new_plot(dir_cfg, sched_cfg, plotting_cfg):
dstdir = max(dir2ph, key=dir2ph.get)

logfile = os.path.join(
dir_cfg.log, datetime.now().strftime('%Y-%m-%d-%H:%M:%S.log')
dir_cfg.log, pendulum.now().strftime('%Y-%m-%dT%H_%M_%S.%f%z.log')
BasilHorowt marked this conversation as resolved.
Show resolved Hide resolved
)

plot_args = ['chia', 'plots', 'create',
Expand Down