Skip to content

Commit f26a758

Browse files
committed
feat: increased timeout for fetch links and slightly improved logging
1 parent 444a5a0 commit f26a758

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

functions/fetch-links/handler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ export async function fetchLinks (event) {
3737

3838
const fallbackImageClient = createFallbackImageClient(process.env.UNSPLASH_ACCESS_KEY)
3939

40-
const now = moment.tz('Etc/UTC')
41-
const referenceMoment = now
40+
const referenceMoment = moment(new Date(event.config.time))
4241
.clone()
4342
.subtract('1', 'week')
4443
.startOf('day')
44+
console.log(JSON.stringify({ message: 'Reference moment', referenceMoment: referenceMoment.format() }))
4545

4646
const nextIssue = event.NextIssue.number
4747
const campaignName = `fullstackBulletin-${nextIssue}`

template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Resources:
146146
CodeUri: functions/fetch-links/
147147
Handler: handler.fetchLinks
148148
Runtime: nodejs20.x
149-
Timeout: 60
149+
Timeout: 120
150150
Architectures:
151151
- x86_64
152152
Policies:

0 commit comments

Comments
 (0)