Skip to content

Commit 2e55243

Browse files
committed
1 parent 1399c14 commit 2e55243

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/services/githubService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ export const getDoobooStats = async ({
575575
},
576576
};
577577

578-
const updatedAt = new Date(userPlugin?.updated_at || '');
578+
const updatedAt = userPlugin?.updated_at ? new Date(userPlugin?.updated_at) : null;
579579
const today = new Date();
580580

581581
// When user was queried after 3 hours, update the data in background.
@@ -589,7 +589,7 @@ export const getDoobooStats = async ({
589589
})
590590
.match({login: userPlugin.login});
591591

592-
if (diffHours(updatedAt, today) < 3) {
592+
if (!updatedAt || diffHours(updatedAt, today) < 3) {
593593
upsertGithubStats({
594594
plugin,
595595
user_plugin: userPlugin,

0 commit comments

Comments
 (0)