ideal / mirror

Task scheduler for open source mirror site (initially for https://mirror.bjtu.edu.cn)
Other
207 stars 51 forks source link

建议simple task返回值非0时记录failed #11

Open chestnutprog opened 5 years ago

chestnutprog commented 5 years ago

RT,刚才发现pypi已经挂了很久但是因为不检查返回值所以一直显示success.

AlynxZhou commented 5 years ago

@chestnutprog 是 pypi 自己的问题,它同步用的不是 rsync,成功时候不返回 0,对于这种不按套路出牌的要解决很麻烦。

ideal commented 5 years ago

@AlynxZhou https://github.com/pypa/bandersnatch 是这个吗?出错时返回了0?

AlynxZhou commented 5 years ago

我记得是这样的。然后我在网页端写了个判断规避,但似乎翻车了? Screenshot from 2019-05-14 21-13-37

ideal commented 5 years ago

@chestnutprog 方便看下pypi的同步日志吗?

chestnutprog commented 5 years ago
 31 2019-05-08 16:55:00,668 INFO: bandersnatch/1.11 (CPython 2.7.12-final0, Linux 4.4.0-81-generic x    86_64)
 32 Traceback (most recent call last):
 33   File "/usr/local/bin/bandersnatch", line 11, in <module>
 34     load_entry_point('bandersnatch==1.11', 'console_scripts', 'bandersnatch')()
 35   File "/usr/local/lib/python2.7/dist-packages/bandersnatch/main.py", line 69, in main
 36     args.func(config)
 37   File "/usr/local/lib/python2.7/dist-packages/bandersnatch/main.py", line 27, in mirror
 38     hash_index=config.getboolean('mirror', 'hash-index'))
 39   File "/usr/local/lib/python2.7/dist-packages/bandersnatch/mirror.py", line 65, in __init__
 40     self._bootstrap()
 41   File "/usr/local/lib/python2.7/dist-packages/bandersnatch/mirror.py", line 251, in _bootstrap
 42     self._load()
 43   File "/usr/local/lib/python2.7/dist-packages/bandersnatch/mirror.py", line 271, in _load
 44     generation = int(open(self.generationfile, 'r').read().strip())
 45 ValueError: invalid literal for int() with base 10: ''

之前同步根本没跑起来

AlynxZhou commented 5 years ago

这玩意根本不走 rsync 来着……

ideal commented 5 years ago

@AlynxZhou 嗯这个是bandersnatch不是rsync,有点疑惑的是,按照 @chestnutprog 的日志,这个时候的exit code也是0?