Compare commits
1 Commits
master
...
a3e3e568b4
| Author | SHA1 | Date | |
|---|---|---|---|
| a3e3e568b4 |
@@ -5,7 +5,7 @@ from app.routers import acquire
|
||||
from app.routers import release
|
||||
|
||||
from app.storage import mongo
|
||||
from app.daemons import base
|
||||
from daemons import base
|
||||
|
||||
|
||||
class Daemon(base.Daemon):
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import datetime
|
||||
import fastapi
|
||||
import pydantic
|
||||
|
||||
from app.storage.mongo import locks
|
||||
from app.utils import time
|
||||
|
||||
|
||||
class RequestBody(pydantic.BaseModel):
|
||||
name: str
|
||||
ttl: int
|
||||
|
||||
|
||||
router = fastapi.APIRouter()
|
||||
|
||||
@@ -18,3 +18,9 @@ def create_indexes():
|
||||
database.get_collection('locks').create_index([
|
||||
('name', 1),
|
||||
], unique=True)
|
||||
|
||||
|
||||
def remove_outdated():
|
||||
client = pymongo.MongoClient(CONNECTION_STRING)
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user