Spaces:
Running
Running
Upload 2 files
Browse files- space_checker.py +13 -0
- start.sh +4 -0
space_checker.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
import time
|
3 |
+
import os
|
4 |
+
|
5 |
+
space_url = os.getenv('SPACE_URL')
|
6 |
+
|
7 |
+
def fetch_url(url):
|
8 |
+
response = requests.get(url)
|
9 |
+
print(response.text)
|
10 |
+
|
11 |
+
while True:
|
12 |
+
fetch_url(space_url)
|
13 |
+
time.sleep(3600)
|
start.sh
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
gunicorn -b 0.0.0.0:7860 main:app --timeout 120
|
3 |
+
python space_checker.py &
|
4 |
+
wait
|