Skip to content

Commit

Permalink
add requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Mar 13, 2024
1 parent ee8804b commit a2b39f7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions wis2box-management/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

FROM ubuntu:focal

LABEL maintainer="tomkralidis@gmail.com; mlimper@wmo.int"

ARG WIS2BOX_PIP3_EXTRA_PACKAGES
ENV TZ="Etc/UTC" \
DEBIAN_FRONTEND="noninteractive" \
Expand Down
2 changes: 1 addition & 1 deletion wis2box-management/wis2box/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def execute_api_process(process_name: str, payload: dict) -> dict:
location = location.replace(API_URL, DOCKER_API_URL)

status = 'accepted'
while status == 'accepted' or status == 'running':
while status in ['accepted', 'running']:
# get the job status
headers = {
'accept': 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions wis2box-management/wis2box/data/bufr2geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ def transform(self, input_data: Union[Path, bytes],
result = execute_api_process(process_name, payload)

# check for errors
if 'error' in result and result['error'] != '':
if result.get('error') not in [None, '']:
LOGGER.error(result['error'])

if 'items' not in result:
LOGGER.error(f'file={filename} failed to convert to geojson')
LOGGER.error(f'file={filename} failed to convert to GeoJSON')
return False

# loop over items in response
Expand Down
2 changes: 1 addition & 1 deletion wis2box-management/wis2box/pubsub/subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def on_message_handler(self, client, userdata, msg):
while len(mp.active_children()) == mp.cpu_count():
sleep(0.1)
mp.Process(target=self.handle, args=(filepath,)).start()
elif (topic == 'wis2box/data/publication'):
elif topic == 'wis2box/data/publication':
LOGGER.debug('Publishing data')
self.handle_publish(message)
elif topic == 'wis2box/data_mappings/refresh':
Expand Down

0 comments on commit a2b39f7

Please sign in to comment.