Check whether our mirror packages are up to date.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
"""
|
|
|
|
Contains CPAN class
|
|
|
|
"""
|
|
|
|
|
|
|
|
import requests
|
|
|
|
|
|
|
|
from project import Project
|
|
|
|
from shared import CSC_MIRROR
|
|
|
|
|
|
|
|
|
|
|
|
class CPAN(Project):
|
|
|
|
"""CPAN class"""
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def check(data, project, current_time):
|
|
|
|
res_json = requests.get("http://mirrors.cpan.org/cpan-json.txt").json()
|
|
|
|
for mirror in res_json:
|
|
|
|
if mirror["url"] == f"{CSC_MIRROR}CPAN/":
|
|
|
|
return current_time - int(mirror["age"]) <= data[project]["out_of_sync_interval"]
|
|
|
|
return False
|