Skip to content

Commit

Permalink
timeout if downloading content takes more than 10 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
sywhb committed Jul 24, 2024
1 parent 4e04842 commit 158877a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const fetchContentForItems = async (
item.content = await Promise.race([
downloadFromUrl(c.downloadUrl),
new Promise<string>(
(_, reject) => setTimeout(() => reject('Timeout'), 60_000) // 60 seconds
(_, reject) => setTimeout(() => reject('Timeout'), 600_000) // 10 minutes
),
])
})
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,7 @@ const fetchOmnivore = async (inBackground = false) => {
await logseq.Editor.deletePage(pageName)
continue
}
}
else {
} else {
targetBlockId = await getOmnivoreBlockIdentity(pageName, blockTitle)

const existingBlock = await getBlockByContent(
Expand Down
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { diff_match_patch } from 'diff-match-patch'
import { DateTime } from 'luxon'
import escape from 'markdown-escape'
import outOfCharacter from 'out-of-character'
import { Highlight } from './api'
import { Highlight } from '@omnivore-app/api'

export interface HighlightPoint {
left: number
Expand Down

0 comments on commit 158877a

Please sign in to comment.