Skip to content

Commit

Permalink
VBB AUS example: make expiresAt & fetchInterval customisable 📝
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Oct 4, 2024
1 parent 28bd9a3 commit 7ef5671
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/vbb-aus.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ const {
await promisify(httpServer.listen.bind(httpServer))(PORT)
logger.info(`listening on port ${PORT}`)

const expiresAt = process.env.AUS_EXPIRES_AT
? parseInt(process.env.AUS_EXPIRES_AT) * 1000
: Date.now() + 10 * 60 * 1000 // in 10 minutes
const fetchInterval = process.env.AUS_FETCH_INTERVAL
? parseInt(process.env.AUS_FETCH_INTERVAL) * 1000
: 30_000 // 30 seconds

const {aboId} = await ausSubscribe({
expiresAt: Date.now() + 10 * 60 * 1000, // for 10min
expiresAt,
fetchInterval,
})
process.on('SIGINT', () => {
ausUnsubscribe(aboId)
Expand Down

0 comments on commit 7ef5671

Please sign in to comment.