Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9da3ad7

Browse files
authored
Update index.ts
1 parentb71a229 commit9da3ad7

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

‎backend/src/index.ts‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@ import { eventInfo, eventInfoMutex, fetchEvents } from "./data/eventData";
99
dotenv.config();
1010

1111
(async()=>{
12-
try{
13-
constevents=awaitfetchEvents();
14-
eventInfoMutex.runExclusive(()=>eventInfo.push(...events));
15-
console.log("Events fetched successfully");
16-
}catch(error){
17-
// do we ungracefully bail out here???
18-
// could just load from a backup file instead
19-
console.error("Error fetching events on startup:",error);
20-
}
12+
setInterval(()=>{
13+
try{
14+
constevents=awaitfetchEvents();
15+
eventInfoMutex.runExclusive(()=>{
16+
eventInfo.length=0;
17+
eventInfo.push(...events);
18+
});
19+
console.log("Events fetched successfully");
20+
}catch(error){
21+
// do we ungracefully bail out here???
22+
// could just load from a backup file instead
23+
console.error("Error fetching events:",error);
24+
}
25+
},30*60*1000);
2126

2227
constapp:Express=express();
2328
constport=process.env.PORT||9000;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp