Redo ubuntu, double ubuntu_releases OOS interval

This commit is contained in:
Raymond Li 2022-01-16 16:51:44 -05:00
parent bd1573ed71
commit dce2583550
Signed by untrusted user: r389li
GPG Key ID: A014EA89B62BBB1B
3 changed files with 3 additions and 8 deletions

View File

@ -389,7 +389,7 @@
},
"ubuntu_releases": {
"out_of_sync_since": null,
"out_of_sync_interval": 86400,
"out_of_sync_interval": 172800,
"csc": "",
"upstream": "https://launchpad.net/ubuntu/+mirror/mirror.csclub.uwaterloo.ca-release",
"file": ""

View File

@ -36,7 +36,7 @@ if __name__ == "__main__":
if data[project].get('exclude', False):
continue
checker_result = project_class.check(data, project, current_time)
if project in ["CPAN", "ubuntu", "ubuntu_releases", "manjaro", "mxlinux", "cran", "ctan", "gentooportage"]:
if project in ["CPAN", "ubuntu_releases", "manjaro", "mxlinux", "cran", "ctan", "gentooportage"]:
if checker_result:
safe_print(f"Success: {project} up-to-date")
else:

View File

@ -17,9 +17,4 @@ class ubuntu(Project):
@staticmethod
def check(data, project, current_time):
page = requests.get(data[project]["upstream"]).text
indexOfFile = page.find("last verified")
matches = list(datefinder.find_dates(page[indexOfFile:]))
date = matches[0] # date is of type datetime.datetime
return(pd.to_datetime(current_time, unit='s') - date.replace(tzinfo=None) <= pd.to_timedelta(data[project]["out_of_sync_interval"], unit='s'))
# https://launchpad.net/ubuntu/+mirror/mirror.csclub.uwaterloo.ca-archive
return page.count("Up to date") == 21