YNUOSA / auto_repo

YNUOSA Mirrors auto_repo
0 stars 1 forks source link

A unexpected "]" when persist mirror rsync status into json file. #1

Open STRRL opened 4 years ago

STRRL commented 4 years ago

Context in mirrors.json

[{"mirrorname": "kali", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:12"}, {"mirrorname": "deepin", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:14"}, {"mirrorname": "debian-cd", "mirrorstatus": "succeed", "time": "2019-09-07 04:01:19"}, {"mirrorname": "debian-nonfree", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:14"}, {"mirrorname": "kali-security", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:14"}, {"mirrorname": "ubuntu", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:12"}, {"mirrorname": "ubuntu-cdimage", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:14"}, {"mirrorname": "debian-multimedia", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:11"}, {"mirrorname": "debian-security", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:14"}, {"mirrorname": "kali-images", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:12"}, {"mirrorname": "centos", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:13"}, {"mirrorname": "steamos", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:13"}, {"mirrorname": "debian", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:12"}, {"mirrorname": "raspbian", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:12"}, {"mirrorname": "fedora", "mirrorstatus": "succeed", "time": "2019-09-07 04:31:12"}, {"mirrorname": "deepin-cd", "mirrorstatus": "succeed", "time": "2019-09-07 19:01:15"}, {"mirrorname": "archlinuxarm", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:15"}, {"mirrorname": "archlinux", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:14"}, {"mirrorname": "archlinuxcn", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:11"}, {"mirrorname": "docker", "mirrorstatus": "failed", "time": "2019-09-07 05:41:21"}, {"mirrorname": "arch4edu", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:14"}]]

There are two "]" at the end of file.

Reference code:
https://github.com/YNUOSA/auto_repo/blob/onlyrepo/build/mirror/solidfiles/main.py#L46

kmahyyg commented 4 years ago

image

I guess the problem is located at Line53. You shouldn't serialize data in this way. So if I just made its syntax correct, I think it will work? Is is orrect?

kmahyyg commented 4 years ago

Any working example can be offered here by uploading json file?

STRRL commented 4 years ago

Sorry, I can not understand what do you want.

STRRL commented 4 years ago
[{"mirrorname": "kali", "mirrorstatus": "syncing", "time": "2019-09-07 19:01:12"}]
kmahyyg commented 4 years ago

Okay, I understand. PR is on its way.