forked from LiveCarta/LiveCartaMeta
@@ -11,6 +11,3 @@ RUN pip install pymongo \
|
|||||||
requests
|
requests
|
||||||
|
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
|
|
||||||
RUN chmod 777 /app/configs/sources.json
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ class AppConfig:
|
|||||||
username=CONFIGS['db']['username'],
|
username=CONFIGS['db']['username'],
|
||||||
password=CONFIGS['db']['password'],
|
password=CONFIGS['db']['password'],
|
||||||
authentication_source='admin',
|
authentication_source='admin',
|
||||||
host="mongodb://{host}:27017/{database}".format(host=CONFIGS['db']['host'], database=CONFIGS['db']['name'])
|
port=27017,
|
||||||
|
host=CONFIGS['db']['host']
|
||||||
)
|
)
|
||||||
|
|
||||||
def refresh(self):
|
def refresh(self):
|
||||||
|
|||||||
19
update.py
19
update.py
@@ -35,16 +35,19 @@ class Updater:
|
|||||||
|
|
||||||
def do_action(self):
|
def do_action(self):
|
||||||
print("Start Updater");
|
print("Start Updater");
|
||||||
if self.args.config:
|
print("Start Configure")
|
||||||
print("Start Configure")
|
self.update_config()
|
||||||
self.update_config()
|
if hasattr(self.args, 'source') and self.is_source_exists(self.args.source):
|
||||||
|
print("Start single source" + self.args.source)
|
||||||
if not self.is_source_exists(self.args.source):
|
self.parse_source(self.args.source)
|
||||||
print("This source not exists, list of sources: " + ', '.join(config.get_sources_list()))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
print("Start source update")
|
for source in config.get_sources_list():
|
||||||
self.parse_source(self.args.source)
|
try:
|
||||||
|
print("Start source update" + source)
|
||||||
|
self.parse_source(source)
|
||||||
|
except:
|
||||||
|
print(source + " has error")
|
||||||
|
|
||||||
|
|
||||||
updater = Updater()
|
updater = Updater()
|
||||||
|
|||||||
Reference in New Issue
Block a user