Redo ubuntu, double ubuntu_releases OOS interval

alt-impl
Raymond Li 9 months ago
parent bd1573ed71
commit dce2583550
Signed by untrusted user: r389li
GPG Key ID: A014EA89B62BBB1B
  1. 2
      data.json
  2. 2
      main.py
  3. 7
      projects/ubuntu.py

@ -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": ""

@ -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:

@ -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

Loading…
Cancel
Save