small bug fixes

This commit is contained in:
meisnate12 2021-05-09 01:49:13 -04:00
parent 733c606743
commit d053db920f
2 changed files with 3 additions and 3 deletions

View file

@ -148,7 +148,7 @@ class Cache:
expired = time_between_insertion.days > self.expiration expired = time_between_insertion.days > self.expiration
return id_to_return, expired return id_to_return, expired
def _update_map(self, map_name, val1, val1_name, val2, val2_name, expired, media_type=None): def _update_map(self, map_name, val1_name, val1, val2_name, val2, expired, media_type=None):
expiration_date = datetime.now() if expired is True else (datetime.now() - timedelta(days=random.randint(1, self.expiration))) expiration_date = datetime.now() if expired is True else (datetime.now() - timedelta(days=random.randint(1, self.expiration)))
with sqlite3.connect(self.cache_path) as connection: with sqlite3.connect(self.cache_path) as connection:
connection.row_factory = sqlite3.Row connection.row_factory = sqlite3.Row

View file

@ -2,7 +2,7 @@ import argparse, logging, os, re, sys, time
from datetime import datetime from datetime import datetime
try: try:
import schedule import schedule
from modules import tests, util from modules import util
from modules.builder import CollectionBuilder from modules.builder import CollectionBuilder
from modules.config import Config from modules.config import Config
from modules.util import Failed from modules.util import Failed
@ -77,7 +77,7 @@ file_handler.setFormatter(logging.Formatter("[%(asctime)s] %(filename)-27s %(lev
cmd_handler = logging.StreamHandler() cmd_handler = logging.StreamHandler()
cmd_handler.setFormatter(logging.Formatter("| %(message)-100s |")) cmd_handler.setFormatter(logging.Formatter("| %(message)-100s |"))
cmd_handler.setLevel(logging.DEBUG if my_tests or test or debug else logging.INFO) cmd_handler.setLevel(logging.DEBUG if test or debug else logging.INFO)
logger.addHandler(cmd_handler) logger.addHandler(cmd_handler)
logger.addHandler(file_handler) logger.addHandler(file_handler)