Skip to content

Commit

Permalink
Release v0.2.3: Fix archive summary table not updated and add delay
Browse files Browse the repository at this point in the history
  • Loading branch information
CAM-Gerlach committed Nov 19, 2019
1 parent c5532aa commit 243db90
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Sindri Changelog


## Version 0.2.3 (2019-11-18)

Bufix release with the following changes:

* Fix issue with archive table on sensor page not being updated with new data
* Add delay before first rebuild in test mode to avoid any concurrency issues



## Version 0.2.2 (2019-11-04)

Bufix release with the following changes:
Expand Down
2 changes: 1 addition & 1 deletion src/sindri/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Version file."""

VERSION_INFO = (0, 2, 2)
VERSION_INFO = (0, 2, 3)
__version__ = '.'.join((str(version) for version in VERSION_INFO))
26 changes: 14 additions & 12 deletions src/sindri/website/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def generate_plot_data(


def generate_singlepage_data(page_blocks, full_data,
input_path=None, output_path=None):
input_path_default=None, output_path=None):
data_function_map = {
"dashboard": generate_dashboard_data,
"table": generate_table_data,
Expand All @@ -319,7 +319,7 @@ def generate_singlepage_data(page_blocks, full_data,
if block["type"] == "generic":
continue
input_path = Path(block["args"]["data_args"]
.get("input_path", input_path))
.get("input_path", input_path_default))
if input_path is not None and output_path is not None:
input_path = input_path.expanduser()
update_needed = check_update(
Expand All @@ -344,7 +344,7 @@ def generate_singlepage_data(page_blocks, full_data,


def generate_daily_data(
page_blocks, full_data, input_path, output_path,
page_blocks, full_data, input_path_default, output_path,
filename_template, file_grouper,
output_args=None, **table_process_args):
if output_args is None:
Expand All @@ -354,7 +354,7 @@ def generate_daily_data(
if page_blocks[section_id]["type"] == "generic":
continue
update_needed = check_update(
input_path,
input_path_default,
output_path / (LASTUPDATE_FILENAME.format(section_id=section_id)))
if not update_needed:
continue
Expand All @@ -377,7 +377,7 @@ def generate_daily_data(

def generate_site_data(content_pages, project_path=None):
full_data = sindri.process.ingest_status_data(n_days=None)
input_path = sindri.process.get_status_data_paths(n_days=1)[0]
input_path_default = sindri.process.get_status_data_paths(n_days=1)[0]
if project_path:
project_path = Path(project_path) / ASSET_PATH
else:
Expand All @@ -388,14 +388,16 @@ def generate_site_data(content_pages, project_path=None):
os.makedirs(output_path, exist_ok=True)
if page["type"] is None:
continue
elif page["type"] == "singlepage":
generate_singlepage_data(
page_blocks=page["blocks"], full_data=full_data,
input_path=input_path, output_path=output_path)
common_args = {
"page_blocks": page["blocks"],
"full_data": full_data,
"input_path_default": input_path_default,
"output_path": output_path,
}
if page["type"] == "singlepage":
generate_singlepage_data(**common_args)
elif page["type"] == "daily":
generate_daily_data(
page_blocks=page["blocks"], full_data=full_data,
input_path=input_path, output_path=output_path, **page["args"])
generate_daily_data(**common_args, **page["args"])
else:
raise ValueError(
"Page type must be one of {None, 'singlepage', 'daily'}, "
Expand Down
4 changes: 4 additions & 0 deletions src/sindri/website/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ def start_serving_website(
wait_exit=False, verbose=verbose)

try:
# Initial 60 s wait to ensure site fully builds once before rerunning
if mode == "test":
for __ in range(58):
time.sleep(1)
while True:
sindri.utils.misc.delay_until_desired_time(update_interval_s)
update_data(project_path=cache_dir)
Expand Down

0 comments on commit 243db90

Please sign in to comment.