Skip to content

Commit a687969

Browse files
committed
fix: updateLastAccessedAt error handling
1 parent 5170532 commit a687969

File tree

1 file changed

+12
-8
lines changed
  • packages/velog-server/src/services/UserService

1 file changed

+12
-8
lines changed

packages/velog-server/src/services/UserService/index.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,18 @@ export class UserService implements Service {
122122

123123
public async updateLastAccessedAt(userId?: string): Promise<void> {
124124
if (!userId) return
125-
await this.db.userProfile.update({
126-
where: {
127-
fk_user_id: userId,
128-
},
129-
data: {
130-
last_accessed_at: this.utils.now,
131-
},
132-
})
125+
try {
126+
await this.db.userProfile.update({
127+
where: {
128+
fk_user_id: userId,
129+
},
130+
data: {
131+
last_accessed_at: this.utils.now,
132+
},
133+
})
134+
} catch (error) {
135+
console.error('updateLastAccessedAt error', error)
136+
}
133137
}
134138
public async restoreToken(ctx: Pick<GraphQLContext, 'request' | 'reply'>): Promise<UserToken> {
135139
const refreshToken: string | undefined = ctx.request.cookies['refresh_token']

0 commit comments

Comments
 (0)