Skip to content

Commit

Permalink
change influxdb server
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyThink committed Jan 1, 2024
1 parent a8c4db9 commit 7962d9d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 10 additions & 1 deletion ytdlbot/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,16 @@ def set_user_settings(self, user_id: int, field: str, value: str):

class InfluxDB:
def __init__(self):
self.client = InfluxDBClient(host=os.getenv("INFLUX_HOST", "192.168.7.233"), database="celery")
self.client = InfluxDBClient(
host=os.getenv("INFLUX_HOST"),
path=os.getenv("INFLUX_PATH"),
port=443,
username="nova",
password=os.getenv("INFLUX_PASS"),
database="celery",
ssl=True,
verify_ssl=True,
)
self.data = None

def __del__(self):
Expand Down
2 changes: 0 additions & 2 deletions ytdlbot/ytdl_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
__author__ = "Benny <[email protected]>"

import contextlib
import gc
import json
import logging
import os
Expand Down Expand Up @@ -576,7 +575,6 @@ def trx_notify(_, **kwargs):
scheduler = BackgroundScheduler(timezone="Europe/London")
scheduler.add_job(auto_restart, "interval", seconds=600)
scheduler.add_job(clean_tempfile, "interval", seconds=120)
scheduler.add_job(gc.collect, "interval", seconds=3600)
if not IS_BACKUP_BOT:
scheduler.add_job(Redis().reset_today, "cron", hour=0, minute=0)
scheduler.add_job(InfluxDB().collect_data, "interval", seconds=120)
Expand Down

0 comments on commit 7962d9d

Please sign in to comment.