mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 15:32:30 +03:00
Also write status.json when command finished
This commit is contained in:
parent
10528b832a
commit
153f136e79
1 changed files with 11 additions and 7 deletions
|
@ -900,13 +900,17 @@ def write_status_json(output, pretty=False, name=None):
|
|||
os.makedirs(status_dir)
|
||||
if not name:
|
||||
output['endTimestamp'] = int(datetime.now(timezone.utc).timestamp() * 1000)
|
||||
name = sys.argv[0].split()[1] # fdroid subcommand
|
||||
path = os.path.join(status_dir, name + '.json')
|
||||
with open(path, 'w') as fp:
|
||||
if pretty:
|
||||
json.dump(output, fp, sort_keys=True, cls=Encoder, indent=2)
|
||||
else:
|
||||
json.dump(output, fp, sort_keys=True, cls=Encoder, separators=(',', ':'))
|
||||
names = ['running', sys.argv[0].split()[1]] # fdroid subcommand
|
||||
else:
|
||||
names = [name]
|
||||
|
||||
for fname in names:
|
||||
path = os.path.join(status_dir, fname + '.json')
|
||||
with open(path, "w", encoding="utf-8") as fp:
|
||||
if pretty:
|
||||
json.dump(output, fp, sort_keys=True, cls=Encoder, indent=2)
|
||||
else:
|
||||
json.dump(output, fp, sort_keys=True, cls=Encoder, separators=(',', ':'))
|
||||
rsync_status_file_to_repo(path, repo_subdir='status')
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue