[nominatim-web] Expire entries older than 30 days
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nominatim-web] Expire entries older than 30 days
- Date: Fri, 2 Apr 2021 14:16:37 +0000 (UTC)
commit 43a42c79d0b57c45cb0213a599045b0545947979
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date: Fri Apr 2 16:16:22 2021 +0200
Expire entries older than 30 days
app/main.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/app/main.py b/app/main.py
index 536e4b0..d2f9636 100644
--- a/app/main.py
+++ b/app/main.py
@@ -8,7 +8,6 @@ import requests
from fastapi import FastAPI, Request, Response
from pydantic import BaseSettings
-
class Settings(BaseSettings):
api_url: str = "https://nominatim.openstreetmap.org"
redis_host: str = "localhost"
@@ -145,7 +144,7 @@ def reverse(request: Request):
@app.get("/expire")
def expire():
- limit = datetime.datetime.now() - datetime.timedelta(seconds=30)
+ limit = datetime.datetime.now() - datetime.timedelta(days=30)
with postgres.cursor() as cur:
cur.execute("DELETE FROM search WHERE created_at < %s", (limit,))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]