Commit 4fa9015c authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Implement mirroring of orphaned datasets

parent e330b807
......@@ -33,9 +33,6 @@ else:
entries = process_entry.get_entries(names).values()
for entry in entries:
if entry.orphan:
print("skipped orphan:", entry.name)
continue
with acquire_lock(entry, block=False) as lock:
if lock is None:
print("skipped:", entry.name)
......
......@@ -32,9 +32,6 @@ else:
entries = process_entry.get_entries(names)
for entry in entries.values():
if entry.orphan:
print("skipped orphan:", entry.name)
continue
with acquire_lock(entry, block=False) as lock:
if lock is None:
print("skip", entry.name)
......
......@@ -58,6 +58,14 @@ def get_entries(names=None):
entry.restricted = False
if not hasattr(entry, "orphan"):
entry.orphan = False
if entry.orphan:
prefix = entry.upstream_prefix
entry.orig_upstream_prefix = prefix
for suf in ["http://", "https://", "gdrive://"]:
prefix = prefix.lstrip(suf)
prefix = "https://downloads.skewed.de/mirror/" + prefix
entry.upstream_prefix = prefix
hfile = f"./cache/upstream/{entry.name}/.health"
try:
with open(hfile, "rb") as f:
......
......@@ -38,7 +38,7 @@ active
<dt>Upstream URL
<span style="font-size: smaller; vertical-align: text-top; padding-left: 1em">
{% if entry.orphan %}
<span class="ink-label grey" title="Dead."></span>
<span class="ink-label grey" title="Upstream is no more. It has ceased to be. It has expired and gone to meet its maker. It's an ex-upstream!"></span>
{% elif entry.upstream_status[0] == 200 %}
<span class="ink-label green" title="Upstream health OK. Last checked on {{entry.upstream_status[1]}}">OK</span>
{% else %}
......@@ -49,7 +49,7 @@ active
</dt>
<dd>
{% if entry.orphan %}
The upstream source has since vanished.
The upstream source has since vanished. The files can be temporarily accessed <a href="{{entry.upstream_prefix}}">here</a>.
{% else %}
<a href="{{entry.url}}">{{entry.url}}</a>
{% endif %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment