@@ -11,10 +11,10 @@ import {
1111 newAssetId ,
1212 saveAsset ,
1313} from "@karakeep/shared/assetdb" ;
14+ import serverConfig from "@karakeep/shared/config" ;
1415import logger from "@karakeep/shared/logger" ;
1516import { tryCatch } from "@karakeep/shared/tryCatch" ;
1617
17- import { HTML_CONTENT_SIZE_THRESHOLD } from "../../../constants" ;
1818import { updateAsset } from "../../../workerUtils" ;
1919
2020const BATCH_SIZE = 25 ;
@@ -40,12 +40,12 @@ async function getBookmarksWithLargeInlineHtml(limit: number, cursor?: string) {
4040 gt ( bookmarkLinks . id , cursor ) ,
4141 isNotNull ( bookmarkLinks . htmlContent ) ,
4242 isNull ( bookmarkLinks . contentAssetId ) ,
43- sql `length(CAST(${ bookmarkLinks . htmlContent } AS BLOB)) > ${ HTML_CONTENT_SIZE_THRESHOLD } ` ,
43+ sql `length(CAST(${ bookmarkLinks . htmlContent } AS BLOB)) > ${ serverConfig . crawler . htmlContentSizeThreshold } ` ,
4444 )
4545 : and (
4646 isNotNull ( bookmarkLinks . htmlContent ) ,
4747 isNull ( bookmarkLinks . contentAssetId ) ,
48- sql `length(CAST(${ bookmarkLinks . htmlContent } AS BLOB)) > ${ HTML_CONTENT_SIZE_THRESHOLD } ` ,
48+ sql `length(CAST(${ bookmarkLinks . htmlContent } AS BLOB)) > ${ serverConfig . crawler . htmlContentSizeThreshold } ` ,
4949 ) ,
5050 )
5151 . orderBy ( asc ( bookmarkLinks . id ) )
@@ -62,7 +62,7 @@ async function migrateBookmarkHtml(
6262
6363 const contentSize = Buffer . byteLength ( htmlContent , "utf8" ) ;
6464
65- if ( contentSize <= HTML_CONTENT_SIZE_THRESHOLD ) {
65+ if ( contentSize <= serverConfig . crawler . htmlContentSizeThreshold ) {
6666 logger . debug (
6767 `[adminMaintenance:migrate_large_link_html][${ jobId } ] Bookmark ${ bookmarkId } inline HTML (${ contentSize } bytes) below threshold, skipping` ,
6868 ) ;
0 commit comments