Skip to content

Commit 243db90

Browse files
committed
Release v0.2.3: Fix archive summary table not updated and add delay
1 parent c5532aa commit 243db90

File tree

4 files changed

+28
-13
lines changed

4 files changed

+28
-13
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Sindri Changelog
22

33

4+
## Version 0.2.3 (2019-11-18)
5+
6+
Bufix release with the following changes:
7+
8+
* Fix issue with archive table on sensor page not being updated with new data
9+
* Add delay before first rebuild in test mode to avoid any concurrency issues
10+
11+
12+
413
## Version 0.2.2 (2019-11-04)
514

615
Bufix release with the following changes:

src/sindri/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Version file."""
22

3-
VERSION_INFO = (0, 2, 2)
3+
VERSION_INFO = (0, 2, 3)
44
__version__ = '.'.join((str(version) for version in VERSION_INFO))

src/sindri/website/generate.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def generate_plot_data(
307307

308308

309309
def generate_singlepage_data(page_blocks, full_data,
310-
input_path=None, output_path=None):
310+
input_path_default=None, output_path=None):
311311
data_function_map = {
312312
"dashboard": generate_dashboard_data,
313313
"table": generate_table_data,
@@ -319,7 +319,7 @@ def generate_singlepage_data(page_blocks, full_data,
319319
if block["type"] == "generic":
320320
continue
321321
input_path = Path(block["args"]["data_args"]
322-
.get("input_path", input_path))
322+
.get("input_path", input_path_default))
323323
if input_path is not None and output_path is not None:
324324
input_path = input_path.expanduser()
325325
update_needed = check_update(
@@ -344,7 +344,7 @@ def generate_singlepage_data(page_blocks, full_data,
344344

345345

346346
def generate_daily_data(
347-
page_blocks, full_data, input_path, output_path,
347+
page_blocks, full_data, input_path_default, output_path,
348348
filename_template, file_grouper,
349349
output_args=None, **table_process_args):
350350
if output_args is None:
@@ -354,7 +354,7 @@ def generate_daily_data(
354354
if page_blocks[section_id]["type"] == "generic":
355355
continue
356356
update_needed = check_update(
357-
input_path,
357+
input_path_default,
358358
output_path / (LASTUPDATE_FILENAME.format(section_id=section_id)))
359359
if not update_needed:
360360
continue
@@ -377,7 +377,7 @@ def generate_daily_data(
377377

378378
def generate_site_data(content_pages, project_path=None):
379379
full_data = sindri.process.ingest_status_data(n_days=None)
380-
input_path = sindri.process.get_status_data_paths(n_days=1)[0]
380+
input_path_default = sindri.process.get_status_data_paths(n_days=1)[0]
381381
if project_path:
382382
project_path = Path(project_path) / ASSET_PATH
383383
else:
@@ -388,14 +388,16 @@ def generate_site_data(content_pages, project_path=None):
388388
os.makedirs(output_path, exist_ok=True)
389389
if page["type"] is None:
390390
continue
391-
elif page["type"] == "singlepage":
392-
generate_singlepage_data(
393-
page_blocks=page["blocks"], full_data=full_data,
394-
input_path=input_path, output_path=output_path)
391+
common_args = {
392+
"page_blocks": page["blocks"],
393+
"full_data": full_data,
394+
"input_path_default": input_path_default,
395+
"output_path": output_path,
396+
}
397+
if page["type"] == "singlepage":
398+
generate_singlepage_data(**common_args)
395399
elif page["type"] == "daily":
396-
generate_daily_data(
397-
page_blocks=page["blocks"], full_data=full_data,
398-
input_path=input_path, output_path=output_path, **page["args"])
400+
generate_daily_data(**common_args, **page["args"])
399401
else:
400402
raise ValueError(
401403
"Page type must be one of {None, 'singlepage', 'daily'}, "

src/sindri/website/serve.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ def start_serving_website(
111111
wait_exit=False, verbose=verbose)
112112

113113
try:
114+
# Initial 60 s wait to ensure site fully builds once before rerunning
115+
if mode == "test":
116+
for __ in range(58):
117+
time.sleep(1)
114118
while True:
115119
sindri.utils.misc.delay_until_desired_time(update_interval_s)
116120
update_data(project_path=cache_dir)

0 commit comments

Comments
 (0)