Skip to content

Commit

Permalink
fix: revert cache and cronjob from few days to daily (#107)
Browse files Browse the repository at this point in the history
* revert: turn cache and cronjob to daily

* chore: disable and update footer community items

* style: fix lint warning
  • Loading branch information
dazedbear authored Feb 11, 2024
1 parent 5d5d435 commit 388c09e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/failsafe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
pull_request:
branches: [main]
schedule:
# 18:00 GMT+8 every Monday
- cron: '0 10 * * 1'
# 18:00 GMT+8 every day
- cron: '0 10 * * *'

env:
AWS_REGION: ${{ secrets.AWS_REGION }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
pull_request:
branches: [main]
schedule:
# 18:30 GMT+8 every Monday and Thursday
- cron: '30 10 * * 1,4'
# 18:30 GMT+8 every day
- cron: '30 10 * * *'

jobs:
wait-for-deployment:
Expand Down
12 changes: 6 additions & 6 deletions site.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ module.exports = {
ttls: {
// seconds
default: 30,
sitemap: 86400 * 7,
notionPage: 86400 * 7,
sitemap: 86400,
notionPage: 86400,
previewImage: 86400 * 30,
},
url: env.get('CACHE_CLIENT_API_URL').asString(),
Expand Down Expand Up @@ -190,8 +190,8 @@ module.exports = {
userName: 'dazedbear',
},
youtube: {
channelBaseUrl: 'https://www.youtube.com/channel',
channelHash: 'UCvyYCMFjUbcHtZhnC-VGwHw',
channelBaseUrl: 'https://www.youtube.com',
channelHash: '@dazedbearstudio',
},
},
communityFeatures: {
Expand All @@ -206,11 +206,11 @@ module.exports = {
},
{
name: 'musicLogbook',
enable: true,
enable: false,
},
{
name: 'openprocessing',
enable: true,
enable: false,
},
{
name: 'soundcloud',
Expand Down
4 changes: 2 additions & 2 deletions src/libs/server/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export const fetchArticleStream = async ({
req,
}
log(options)
throw 'Required info are invalid in fetchArticleStream.'
throw Error('Required info are invalid in fetchArticleStream.')
}

const response = await getNotionPage(id)
Expand Down Expand Up @@ -198,7 +198,7 @@ export const fetchSinglePage = async ({
req,
}
log(options)
throw 'Required info are invalid in fetchSinglePage.'
throw Error('Required info are invalid in fetchSinglePage.')
}

const response = await getNotionPage(id)
Expand Down
16 changes: 8 additions & 8 deletions src/libs/server/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const transformArticleStream = async (
level: 'warn',
}
log(options)
throw 'articleStream is invalid'
throw Error('articleStream is invalid')
}

return articleStream
Expand Down Expand Up @@ -191,7 +191,7 @@ export const transformSingleArticle = async (
level: 'warn',
}
log(options)
throw 'singleArticle is invalid'
throw Error('singleArticle is invalid')
}

return singleArticle
Expand Down Expand Up @@ -231,7 +231,7 @@ export const transformSinglePage = async (
level: 'warn',
}
log(options)
throw 'single page is invalid'
throw Error('single page is invalid')
}

return pageContent
Expand Down Expand Up @@ -296,7 +296,7 @@ export const transformMenuItems = (
level: 'warn',
}
log(options)
throw 'menuItems are invalid'
throw Error('menuItems are invalid')
}

return menuItems
Expand Down Expand Up @@ -344,7 +344,7 @@ export const transformArticleSinglePageMeta = (
level: 'warn',
}
log(options)
throw 'page meta are invalid'
throw Error('page meta are invalid')
}

return pageMeta
Expand Down Expand Up @@ -397,7 +397,7 @@ export const transformPageUrls = (
level: 'warn',
}
log(options)
throw 'page urls are invalid'
throw Error('page urls are invalid')
}

return pageUrls
Expand All @@ -414,7 +414,7 @@ export const transformStreamActionPayload = (
articleStream: ArticleStream
): StreamActionPayloadState => {
return {
name: pageName as string,
name: pageName,
data: {
content: cloneDeep(articleStream.content),
hasNext: articleStream.hasNext,
Expand All @@ -436,7 +436,7 @@ export const transformPageActionPayload = (
pageContent: SinglePage
): StreamActionPayloadState => {
return {
name: pageName as string,
name: pageName,
data: cloneDeep(pageContent),
}
}
Expand Down

0 comments on commit 388c09e

Please sign in to comment.