Skip to content

Commit 034c0ae

Browse files
committed
Added a comment to explain the timed reinitialization of the registry
1 parent cc79ba0 commit 034c0ae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

geonode/proxy/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ def unregister_host(self, host):
5151
self.proxy_allowed_hosts.remove(host)
5252

5353
def get_proxy_allowed_hosts(self):
54+
# We register remote hosts from remote URLs at creation time, inside ImporterViewSet.create().
55+
# If for some reason the creation fails we end up having stale or wrong URLs inside the registry.
56+
# We check the last time the registry was updated, and after a certain delta we reinitialize the registry
57+
# which removes any URLs that are not connected to remote datasets
5458
if (
5559
self._last_registry_load is None
5660
or (now() - self._last_registry_load).days >= self._registry_reload_threshold

0 commit comments

Comments
 (0)