(func)
| 78 | """ |
| 79 | |
| 80 | def decorator(func): |
| 81 | hostname = os.environ.get("HOSTNAME") |
| 82 | assert hostname |
| 83 | server = hostname |
| 84 | if hostname.endswith(".us.archive.org"): |
| 85 | server = hostname.split(".")[0] |
| 86 | |
| 87 | if not any(fnmatch.fnmatch(server, pattern) for pattern in allowed_servers): |
| 88 | scheduler.remove_job(func.__name__) |
| 89 | return func |
| 90 | |
| 91 | return decorator |