mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
checkupdates: write status JSON
This commit is contained in:
parent
d16478b10b
commit
e8a6d0f813
1 changed files with 17 additions and 1 deletions
|
|
@ -543,6 +543,18 @@ def checkupdates_app(app):
|
||||||
raise FDroidException("Git commit failed")
|
raise FDroidException("Git commit failed")
|
||||||
|
|
||||||
|
|
||||||
|
def status_update_json(processed, failed):
|
||||||
|
"""Output a JSON file with metadata about this run"""
|
||||||
|
|
||||||
|
logging.debug(_('Outputting JSON'))
|
||||||
|
output = common.setup_status_output(start_timestamp)
|
||||||
|
if processed:
|
||||||
|
output['processed'] = processed
|
||||||
|
if failed:
|
||||||
|
output['failed'] = failed
|
||||||
|
common.write_status_json(output)
|
||||||
|
|
||||||
|
|
||||||
def update_wiki(gplaylog, locallog):
|
def update_wiki(gplaylog, locallog):
|
||||||
if config.get('wiki_server') and config.get('wiki_path'):
|
if config.get('wiki_server') and config.get('wiki_path'):
|
||||||
try:
|
try:
|
||||||
|
|
@ -644,6 +656,8 @@ def main():
|
||||||
return
|
return
|
||||||
|
|
||||||
locallog = ''
|
locallog = ''
|
||||||
|
processed = []
|
||||||
|
failed = dict()
|
||||||
for appid, app in apps.items():
|
for appid, app in apps.items():
|
||||||
|
|
||||||
if options.autoonly and app.AutoUpdateMode in ('None', 'Static'):
|
if options.autoonly and app.AutoUpdateMode in ('None', 'Static'):
|
||||||
|
|
@ -656,13 +670,15 @@ def main():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
checkupdates_app(app)
|
checkupdates_app(app)
|
||||||
|
processed.append(appid)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = _("...checkupdate failed for {appid} : {error}").format(appid=appid, error=e)
|
msg = _("...checkupdate failed for {appid} : {error}").format(appid=appid, error=e)
|
||||||
logging.error(msg)
|
logging.error(msg)
|
||||||
locallog += msg + '\n'
|
locallog += msg + '\n'
|
||||||
|
failed[appid] = str(e)
|
||||||
|
|
||||||
update_wiki(None, locallog)
|
update_wiki(None, locallog)
|
||||||
|
status_update_json(processed, failed)
|
||||||
logging.info(_("Finished"))
|
logging.info(_("Finished"))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue