Skip to content

Commit

Permalink
Updated with master
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenplieger committed Sep 25, 2024
2 parents 2ec2e62 + 280b9e0 commit 3da962d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
18 changes: 16 additions & 2 deletions Docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.1"

services:
adaguc-viewer:
image: openearth/adaguc-viewer
Expand All @@ -19,6 +17,22 @@ services:
options:
max-size: "200k"
max-file: "10"
adaguc-data-explorer:
image: openearth/adaguc-data-explorer
container_name: adaguc-data-explorer
hostname: adaguc-data-explorer
networks:
- adaguc-network
environment:
- "ADAGUC_AUTOWMS_ENDPOINT=${EXTERNALADDRESS}/autowms?"
env_file:
- .env
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
adaguc-server:
image: openearth/adaguc-server
# build: ..
Expand Down
6 changes: 6 additions & 0 deletions Docker/nginx-adaguc/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ http {
proxy_pass http://adaguc-viewer:80/adaguc-viewer/;
}

# Adaguc Data Explorer
location /explorer/ {
proxy_pass http://adaguc-data-explorer:80/;
}


# Adaguc-server endpoints
location /wms {
proxy_pass http://adaguc-server:8080/wms;
Expand Down
2 changes: 1 addition & 1 deletion python/lib/adaguc/runAdaguc.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ async def response_to_cache(redis_pool, key, headers: str, data):
entrytime
+ f"{len(cacheable_headers_json):06d}".encode("utf-8")
+ cacheable_headers_json
+ brotli.compress(data.getvalue(), quality = 4),
+ brotli.compress(data.getvalue(), quality=4),
ex=ttl,
)
await redis_client.aclose()
Expand Down
2 changes: 1 addition & 1 deletion python/python_fastapi_server/routers/caching_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def response_to_cache(redis_pool, request, headers, data, ex: int):
"utf-8"
)
compressed_data = brotli.compress(data, quality=4)
if len(data) < MAX_SIZE_FOR_CACHING:
if len(compressed_data) < MAX_SIZE_FOR_CACHING:
redis_client = redis.Redis(connection_pool=redis_pool)
await redis_client.set(
key,
Expand Down

0 comments on commit 3da962d

Please sign in to comment.