fix manager-solution
This commit is contained in:
@@ -9,6 +9,6 @@ RUN pip install -r requirements.txt
|
||||
COPY manager.py .
|
||||
COPY config.json .
|
||||
|
||||
ENV INACTIVITY_SECONDS=30
|
||||
ENV INACTIVITY_SECONDS=10
|
||||
|
||||
CMD ["python", "manager.py"]
|
||||
@@ -1,5 +1,21 @@
|
||||
{
|
||||
"users": [
|
||||
{
|
||||
"id": "abc",
|
||||
"port": 3004,
|
||||
"container_name": "abc",
|
||||
"volumes": {
|
||||
"v-conf-user1": "/config"
|
||||
},
|
||||
"environment": {
|
||||
"PUID": "1000",
|
||||
"PGID": "1000",
|
||||
"PASSWORD": "Fiscality2025!"
|
||||
},
|
||||
"mem_limit": "3g",
|
||||
"memswap_limit": "5g",
|
||||
"privileged": true
|
||||
},
|
||||
{
|
||||
"id": "user1",
|
||||
"port": 3001,
|
||||
|
||||
@@ -9,7 +9,7 @@ import time
|
||||
import docker
|
||||
|
||||
CONFIG_PATH = "config.json"
|
||||
INACTIVITY_SECONDS = int(os.getenv("INACTIVITY_SECONDS", "1800"))
|
||||
INACTIVITY_SECONDS = int(os.getenv("INACTIVITY_SECONDS", "3"))
|
||||
APP_PORT = 3000
|
||||
|
||||
client = docker.from_env()
|
||||
@@ -157,7 +157,7 @@ async def handle_connection(reader, writer, user):
|
||||
async def idle_checker():
|
||||
"""Stop idle containers"""
|
||||
while True:
|
||||
await asyncio.sleep(30)
|
||||
await asyncio.sleep(10)
|
||||
now = time.time()
|
||||
|
||||
for uid, last_active in list(user_activity.items()):
|
||||
|
||||
Reference in New Issue
Block a user