self ping correct host 2
Browse files
fetch.py
CHANGED
@@ -131,13 +131,13 @@ async def ping():
|
|
131 |
|
132 |
|
133 |
def self_ping():
|
134 |
-
self_host = getenv("SPACE_HOST", "
|
135 |
with httpx.Client() as client:
|
136 |
-
_ = client.get(f"{self_host}/ping")
|
137 |
|
138 |
|
139 |
scheduler = AsyncIOScheduler(executors={"default": AsyncIOExecutor()})
|
140 |
-
scheduler.add_job(self_ping, "interval", minutes=
|
141 |
|
142 |
|
143 |
if __name__ == "__main__":
|
|
|
131 |
|
132 |
|
133 |
def self_ping():
|
134 |
+
self_host = getenv("SPACE_HOST", "0.0.0.0:7860")
|
135 |
with httpx.Client() as client:
|
136 |
+
_ = client.get(f"http://{self_host}/ping")
|
137 |
|
138 |
|
139 |
scheduler = AsyncIOScheduler(executors={"default": AsyncIOExecutor()})
|
140 |
+
scheduler.add_job(self_ping, "interval", minutes=10)
|
141 |
|
142 |
|
143 |
if __name__ == "__main__":
|