reduce max content size to 5MB and 10MB for both content and originalHtml

This commit is contained in:
Hongbo Wu 2023-08-11 14:02:29 +08:00
parent 792cf0b207
commit b18018ab2e
2 changed files with 2 additions and 3 deletions

View file

@ -27,7 +27,7 @@ import {
SearchResponse,
} from './types'
const MAX_CONTENT_LENGTH = 10 * 1024 * 1024 // 10MB
const MAX_CONTENT_LENGTH = 5 * 1024 * 1024 // 5MB and 10MB for both content and originalHtml
const CONTENT_LENGTH_ERROR = 'Your page content is too large to be saved.'
const appendQuery = (builder: ESBuilder, query: string): ESBuilder => {
@ -407,7 +407,6 @@ export const createPage = async (
ctx: PageContext
): Promise<string | undefined> => {
try {
// max 10MB
if (page.content.length > MAX_CONTENT_LENGTH) {
logger.info('page content is too large', {
pageId: page.id,

View file

@ -94,7 +94,7 @@ export const saveNewsletterEmail = async (
color: '#07D2D1',
})
logger.info('newsletter label added: %o', result)
logger.info('newsletter label added', { result })
// sends push notification
const deviceTokens = await getDeviceTokensByUserId(newsletterEmail.user.id)