enzostvs HF staff commited on
Commit
f40f303
β€’
1 Parent(s): d7c9dd1

use correct host

Browse files
Files changed (1) hide show
  1. server.js +4 -2
server.js CHANGED
@@ -20,7 +20,8 @@ app.listen(3000, () => {
20
 
21
  cron.schedule("0 * * * *", async () => {
22
  console.log('Scraping models')
23
- const request = await fetch(`https://${process.env.SPACE_HOST}/api/scrap-models`, {
 
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 request = await fetch(`http://${process.env.SPACE_HOST}/api/models`, {
 
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',