Merge pull request #6 from voko/fix/docker-compose-clean-start
Fix/docker compose clean start
This commit is contained in:
@@ -16,7 +16,8 @@ You can manage feeds and artists in the web UI:
|
||||
- add an artist
|
||||
- remove an artist
|
||||
|
||||
**Artist Search*
|
||||
**Artist Search**
|
||||
|
||||
When adding an artist, the service will query the musicbrainz API for the given string and return a list of matching artists.
|
||||
The user can then click on the artist to add to the feed.
|
||||
|
||||
|
||||
@@ -15,11 +15,26 @@ MB_APP_NAME = os.path.expandvars(os.environ.get('MB_APP_NAME', 'mzb-rss-service'
|
||||
MB_VERSION = os.path.expandvars(os.environ.get('MB_VERSION', '0.1.0'))
|
||||
MB_CONTACT = os.path.expandvars(os.environ.get('MB_CONTACT', 'someone@somewhere.com'))
|
||||
|
||||
# file system dir check
|
||||
if not os.path.exists(CACHE_DIR):
|
||||
os.makedirs(CACHE_DIR)
|
||||
if not os.path.exists(os.path.dirname(FEEDS_FILE_PATH)):
|
||||
os.makedirs(os.path.dirname(FEEDS_FILE_PATH))
|
||||
if not os.path.exists(os.path.dirname(CONFIG_FILE_PATH)):
|
||||
os.makedirs(os.path.dirname(CONFIG_FILE_PATH))
|
||||
|
||||
class Config:
|
||||
def __init__(self):
|
||||
self._feeds_data = self._load_yaml(FEEDS_FILE_PATH)
|
||||
self._settings = self._load_yaml(CONFIG_FILE_PATH)
|
||||
if os.path.exists(CONFIG_FILE_PATH):
|
||||
self._settings = self._load_yaml(CONFIG_FILE_PATH)
|
||||
else:
|
||||
self._settings = {
|
||||
'service': {
|
||||
'days_back': 0,
|
||||
'cache_time_hours': 8
|
||||
}
|
||||
}
|
||||
self.FEEDS_FILE_PATH = FEEDS_FILE_PATH
|
||||
self.CONFIG_FILE_PATH = CONFIG_FILE_PATH
|
||||
self.CACHE_DIR = CACHE_DIR
|
||||
|
||||
@@ -16,6 +16,13 @@ log_format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
mbz_log_level_str = os.environ.get('MBZ_LOG_LEVEL', 'WARNING').upper()
|
||||
mbz_log_level = getattr(logging, mbz_log_level_str, logging.WARNING)
|
||||
|
||||
# file system init
|
||||
if not os.path.exists(os.path.dirname(log_file)):
|
||||
os.makedirs(os.path.dirname(log_file))
|
||||
if not os.path.exists(os.path.dirname(config.CACHE_DIR)):
|
||||
os.makedirs(os.path.dirname(config.CACHE_DIR))
|
||||
|
||||
|
||||
# Configure root logger
|
||||
root_logger = logging.getLogger()
|
||||
root_logger.setLevel(log_level)
|
||||
|
||||
Reference in New Issue
Block a user