remove schedule import from servers

This commit is contained in:
Andrew 2022-01-14 12:57:23 -05:00
parent ef4a31d1e8
commit 210b831a47
2 changed files with 5 additions and 4 deletions

View File

@ -31,7 +31,6 @@ logger = logging.getLogger(__name__)
try:
import psutil
#import pexpect
import schedule
except ModuleNotFoundError as e:
logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True)

View File

@ -11,6 +11,7 @@ import os
import shutil
import tempfile
import threading
from cron_validator import CronValidator
from tornado import locale
from tornado import iostream
@ -991,9 +992,10 @@ class PanelHandler(BaseHandler):
else:
interval_type = ''
cron_string = bleach.clean(self.get_argument('cron', ''))
cron_split = cron_string.split(' ')
if len(cron_split) != 5:
self.redirect("/panel/error?error=INVALID FORMAT: Invalid Cron Format. Cron must have a space between each character and only have a max of 5 characters * * * * *")
try:
CronValidator.parse(cron_string)
except Exception as e:
self.redirect("/panel/error?error=INVALID FORMAT: Invalid Cron Format. {}".format(e))
return
action = bleach.clean(self.get_argument('action', None))
if action == "command":