gitscope
https://dev.kronoz.win/r/marzneshin.git
app/tasks/nodes.py · v0.3.0-alpha10
Source
1 f7af2b3 Dawsh 2y ago from app import marznode
2 12b255b Dawsh 2y ago from app.db import GetDB, crud, get_tls_certificate
3 a47eb4c Dawsh 2y ago
4 a47eb4c Dawsh 2y ago
5 12b255b Dawsh 2y ago async def nodes_startup():
6 a47eb4c Dawsh 2y ago with GetDB() as db:
7 12b255b Dawsh 2y ago certificate = get_tls_certificate(db)
8 12b255b Dawsh 2y ago db_nodes = crud.get_nodes(db=db, enabled=True)
9 12b255b Dawsh 2y ago for db_node in db_nodes:
10 f6a32ea Dawsh 2y ago await marznode.operations.add_node(db_node, certificate)