Skip to content

Commit

Permalink
feat: reset scraper timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
sosweetham committed May 23, 2024
1 parent 5cd584b commit d2df6b4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/src/controllers/bot-banner.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const botBannerController = new Elysia()
.get('/:id', async ({ params }) => {
if (await botBannerBucket.checkAssetExists(params.id)) {
const lastModified = await botBannerBucket.getAssetLastModified(params.id)
if (Date.now() - lastModified.valueOf() > 24 * 60 * 60 * 1000) {
if (Date.now() - lastModified.valueOf() > 5 * 60 * 1000) {
(async () => guildedBotProfileScrape(params.id, 'banner'))().catch((e) => console.error(e))
}
const banner = await botBannerBucket.getAsset(params.id)
Expand Down
2 changes: 1 addition & 1 deletion app/src/controllers/bot-icon.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const botIconController = new Elysia()
.get('/:id', async ({ params }) => {
if (await botIconBucket.checkAssetExists(params.id)) {
const lastModified = await botIconBucket.getAssetLastModified(params.id)
if (Date.now() - lastModified.valueOf() > 24 * 60 * 60 * 1000) {
if (Date.now() - lastModified.valueOf() > 5 * 60 * 1000) {
(async () => guildedBotProfileScrape(params.id, 'icon'))().catch((e) => console.error(e))
}
const avatar = await botIconBucket.getAsset(params.id)
Expand Down
2 changes: 1 addition & 1 deletion app/src/controllers/server-banner.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const serverBannerController = new Elysia()
.get('/:id', async ({ params }) => {
if (await serverBannerBucket.checkAssetExists(params.id)) {
const lastModified = await serverBannerBucket.getAssetLastModified(params.id)
if (Date.now() - lastModified.valueOf() > 24 * 60 * 60 * 1000) {
if (Date.now() - lastModified.valueOf() > 5 * 60 * 1000) {
(async () => guildedServerProfileScrape(params.id, 'banner'))().catch((e) => console.error(e))
}
const banner = await serverBannerBucket.getAsset(params.id)
Expand Down
2 changes: 1 addition & 1 deletion app/src/controllers/server-icon.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const serverIconController = new Elysia()
.get('/:id', async ({ params }) => {
if (await serverIconBucket.checkAssetExists(params.id)) {
const lastModified = await serverIconBucket.getAssetLastModified(params.id)
if (Date.now() - lastModified.valueOf() > 24 * 60 * 60 * 1000) {
if (Date.now() - lastModified.valueOf() > 5 * 60 * 1000) {
(async () => guildedServerProfileScrape(params.id, 'icon'))().catch((e) => console.error(e))
}
const avatar = await serverIconBucket.getAsset(params.id)
Expand Down
2 changes: 1 addition & 1 deletion app/src/controllers/user-avatar.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const userAvatarController = new Elysia()
.get('/:id', async ({ params }) => {
if (await userAvatarBucket.checkAssetExists(params.id)) {
const lastModified = await userAvatarBucket.getAssetLastModified(params.id)
if (Date.now() - lastModified.valueOf() > 24 * 60 * 60 * 1000) {
if (Date.now() - lastModified.valueOf() > 5 * 60 * 1000) {
(async () => guildedUserProfileScrape(params.id, 'avatar'))().catch((e) => console.error(e))
}
const avatar = await userAvatarBucket.getAsset(params.id)
Expand Down
2 changes: 1 addition & 1 deletion app/src/controllers/user-banner.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const userBannerController = new Elysia()
.get('/:id', async ({ params }) => {
if (await userBannerBucket.checkAssetExists(params.id)) {
const lastModified = await userBannerBucket.getAssetLastModified(params.id)
if (Date.now() - lastModified.valueOf() > 24 * 60 * 60 * 1000) {
if (Date.now() - lastModified.valueOf() > 5 * 60 * 1000) {
(async () => guildedUserProfileScrape(params.id, 'banner'))().catch((e) => console.error(e))
}
const banner = await userBannerBucket.getAsset(params.id)
Expand Down

0 comments on commit d2df6b4

Please sign in to comment.