diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index 324bbbab..e445bef9 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -14,7 +14,7 @@ import zlib import html import apscheduler from apscheduler.schedulers.background import BackgroundScheduler -import tzlocal +from tzlocal import get_localzone from app.classes.shared.helpers import helper @@ -143,7 +143,8 @@ class Server: logger.info("Scheduling server {} to start in {} seconds".format(self.name, delay)) console.info("Scheduling server {} to start in {} seconds".format(self.name, delay)) - self.server_scheduler = BackgroundScheduler(timezone=str(tzlocal.get_localzone())) + tz = get_localzone() + self.server_scheduler = BackgroundScheduler(timezone=str(tz)) self.server_scheduler.add_job(self.run_scheduled_server, 'interval', seconds=delay, id=str(self.server_id)) self.server_scheduler.start() diff --git a/app/classes/shared/tasks.py b/app/classes/shared/tasks.py index 186bb5af..efc9e4a5 100644 --- a/app/classes/shared/tasks.py +++ b/app/classes/shared/tasks.py @@ -7,9 +7,8 @@ import logging import threading import asyncio import shutil -import tzlocal +from tzlocal import get_localzone -from pytz import HOUR, timezone from app.classes.controllers.users_controller import Users_Controller from app.classes.shared.helpers import helper @@ -52,7 +51,8 @@ class TasksManager: self.controller = controller self.tornado = Webserver(controller, self) - self.scheduler = BackgroundScheduler(timezone=str(tzlocal.get_localzone())) + tz = get_localzone() + self.scheduler = BackgroundScheduler(timezone=str(tz)) self.users_controller = Users_Controller() diff --git a/main.py b/main.py index ed055d82..50fa17ef 100644 --- a/main.py +++ b/main.py @@ -140,8 +140,8 @@ if __name__ == '__main__': # refresh our cache and schedule for every 12 hoursour cache refresh for serverjars.com tasks_manager.serverjar_cache_refresher() - logger.info("Checking Internet/Port Service. This may take a minute.") - console.info("Checking Internet/Port Service. This may take a minute.") + logger.info("Checking Internet. This may take a minute.") + console.info("Checking Internet. This may take a minute.") if not helper.check_internet(): console.warning("We have detected the machine running Crafty has no connection to the internet. Client connections to the server may be limited.") diff --git a/requirements.txt b/requirements.txt index 8b91446a..77b89f43 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,6 +15,4 @@ tornado~=6.0 cached_property==1.5.2 apscheduler~=3.8.1 cron-validator~=1.0.3 -tzlocal~=4.1 -pytz -tzdata~=2021.5 \ No newline at end of file +tzlocal~=4.1 \ No newline at end of file