Skip to content

Commit

Permalink
Merge branch 'master' of github.com:KNMI/adaguc-server into update-sc…
Browse files Browse the repository at this point in the history
…an-scripts
  • Loading branch information
maartenplieger committed Oct 23, 2024
2 parents 46d6fa6 + 209a5a5 commit 703ae35
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
vuln-type: 'os,library'
trivyignores: .trivyignore
# severity: 'CRITICAL,HIGH'
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1
docker-build-and-publish:
name: Build Docker image and potentially push to Docker Hub
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ USER root
LABEL maintainer="[email protected]"

# Version should be same as in Definitions.h
LABEL version="2.28.1"
LABEL version="2.28.2"

# Try to update image packages
RUN apt-get -q -y update \
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**Version 2.28.2 2024-10-23**
- Fix bug which caused sheduled metadata updates to only work intermittently.

**Version 2.28.1 2024-10-11**
- Windbarbs on modelfields can now display the windspeed in kts as text when rendertextforvectors in RenderSettings is set to true.

Expand Down
2 changes: 1 addition & 1 deletion adagucserverEC/Definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#ifndef Definitions_H
#define Definitions_H

#define ADAGUCSERVER_VERSION "2.28.1" // Please also update in the Dockerfile to the same version
#define ADAGUCSERVER_VERSION "2.28.2" // Please also update in the Dockerfile to the same version

// CConfigReaderLayerType
#define CConfigReaderLayerTypeUnknown 0
Expand Down
9 changes: 3 additions & 6 deletions python/lib/adaguc/runAdaguc.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,13 @@ def getAdagucEnv(self, adagucenv = {}):

return adagucenv

def updateLayerMetadata(self):
async def updateLayerMetadata(self):
"""Uses the adaguc executable to update the layermetadatatable"""
adagucenv = self.getAdagucEnv()
status, data, headers = asyncio.run(
self.runADAGUCServer(
args=["--updatelayermetadata"], env=adagucenv, isCGI=False, showLogOnError = True
)
status, data, headers = await self.runADAGUCServer(
args=["--updatelayermetadata"], env=adagucenv, isCGI=False, showLogOnError = True
)


return status, data.getvalue().decode()

def scanDataset(self, datasetName):
Expand Down
7 changes: 5 additions & 2 deletions python/python_fastapi_server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os
import time
from contextlib import asynccontextmanager
from urllib.parse import urlsplit
from apscheduler.schedulers.asyncio import AsyncIOScheduler
import uvicorn
Expand All @@ -25,17 +26,19 @@

logger = logging.getLogger(__name__)

def update_layermetadatatable():

async def update_layermetadatatable():
"""Update layermetadata table in adaguc for GetCapabilities caching"""
adaguc = setup_adaguc(False)
logger.info("Calling updateLayerMetadata")
status, log = adaguc.updateLayerMetadata()
status, log = await adaguc.updateLayerMetadata()
if adaguc.isLoggingEnabled():
logger.info(log)
else:
logger.info("Logging for updateLayerMetadata is disabled, status was %d", status)


@asynccontextmanager
async def lifespan(_fastapiapp: FastAPI):
"""Captures FASTAPI Lifespan events to start the AsyncIOScheduler"""

Expand Down

0 comments on commit 703ae35

Please sign in to comment.