Skip to content

Commit

Permalink
have station metadata init as empty on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Sep 10, 2023
1 parent f42e767 commit 13ff6a1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion wis2box-management/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ wis2box environment create
wis2box environment show
wis2box api setup
wis2box metadata discovery setup
wis2box metadata station publish-collection
wis2box metadata station setup
echo "END /entrypoint.sh"
exec "$@"
4 changes: 2 additions & 2 deletions wis2box-management/docker/wis2box.cron
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0 0 * * * su wis2box -c "wis2box data clean --days=$WIS2BOX_DATA_RETENTION_DAYS" > /proc/1/fd/1 2>/proc/1/fd/2
0 1 * * * su wis2box -c "wis2box data archive" > /proc/1/fd/1 2>/proc/1/fd/2
*/10 * * * * su wis2box -c "wis2box metadata station publish-collection" > /proc/1/fd/1 2>/proc/1/fd/2
*/10 * * * * su wis2box -c "echo 'wis2box.cron is alive'" > /proc/1/fd/1 2>/proc/1/fd/2
#*/10 * * * * su wis2box -c "wis2box metadata station publish-collection" > /proc/1/fd/1 2>/proc/1/fd/2
/10 * * * * su wis2box -c "echo 'wis2box.cron is alive'" > /proc/1/fd/1 2>/proc/1/fd/2
13 changes: 11 additions & 2 deletions wis2box-management/wis2box/metadata/station.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ def publish_station_collection() -> None:
:returns: `None`
"""

setup_collection(meta=gcm())

oscar_baseurl = 'https://oscar.wmo.int/surface/#/search/station/stationReportDetails' # noqa

LOGGER.debug(f'Publishing station list from {STATIONS}')
Expand Down Expand Up @@ -312,6 +310,16 @@ def get_geometry(wsi: str = '') -> Union[dict, None]:
return None


@click.command()
@click.pass_context
@cli_helpers.OPTION_VERBOSITY
def setup(ctx, verbosity):
"""Initializes metadata repository"""

click.echo('Setting up station metadata repository')
setup_collection(meta=gcm())


@click.command()
@click.pass_context
@click.option('--wigos-station-identifier', '-wsi',
Expand Down Expand Up @@ -360,3 +368,4 @@ def publish_collection(ctx, verbosity):

station.add_command(get)
station.add_command(publish_collection)
station.add_command(setup)

0 comments on commit 13ff6a1

Please sign in to comment.