Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
use correct host
Browse files
server.js
CHANGED
@@ -20,7 +20,8 @@ app.listen(3000, () => {
|
|
20 |
|
21 |
cron.schedule("0 * * * *", async () => {
|
22 |
console.log('Scraping models')
|
23 |
-
const
|
|
|
24 |
method: 'POST',
|
25 |
headers: {
|
26 |
'Content-Type': 'application/json',
|
@@ -33,7 +34,8 @@ cron.schedule("0 * * * *", async () => {
|
|
33 |
|
34 |
cron.schedule("0 0 * * 1,4", async () => {
|
35 |
console.log('Updating models')
|
36 |
-
const
|
|
|
37 |
method: 'PATCH',
|
38 |
headers: {
|
39 |
'Content-Type': 'application/json',
|
|
|
20 |
|
21 |
cron.schedule("0 * * * *", async () => {
|
22 |
console.log('Scraping models')
|
23 |
+
const first_space_host = process.env.SPACE_HOST?.split(',')[0] ?? process.env.SPACE_HOST
|
24 |
+
const request = await fetch(`https://${first_space_host}/api/scrap-models`, {
|
25 |
method: 'POST',
|
26 |
headers: {
|
27 |
'Content-Type': 'application/json',
|
|
|
34 |
|
35 |
cron.schedule("0 0 * * 1,4", async () => {
|
36 |
console.log('Updating models')
|
37 |
+
const first_space_host = process.env.SPACE_HOST?.split(',')[0] ?? process.env.SPACE_HOST
|
38 |
+
const request = await fetch(`http://${first_space_host}/api/models`, {
|
39 |
method: 'PATCH',
|
40 |
headers: {
|
41 |
'Content-Type': 'application/json',
|