Skip to content

Commit

Permalink
delay save to database 30s (old 15s)
Browse files Browse the repository at this point in the history
  • Loading branch information
tachibana-shin committed May 28, 2023
1 parent 1c63ea0 commit 3d13b5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/BrtPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ import type { PlayerLink } from "src/apis/runs/ajax/player-link"
import { useMemoControl } from "src/composibles/memo-control"
import {
C_URL,
DELAY_SAVE_HISTORY,
DELAY_SAVE_VIEWING_PROGRESS,
playbackRates,
servers,
Expand Down Expand Up @@ -1138,7 +1139,7 @@ function throttle<T extends (...args: any[]) => void>(
},
firstSaveStore.has(uidChap.value)
? DELAY_SAVE_VIEWING_PROGRESS
: DELAY_SAVE_VIEWING_PROGRESS / 2
: DELAY_SAVE_HISTORY
)
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
3 changes: 2 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export const playbackRates = [
},
]

export const DELAY_SAVE_VIEWING_PROGRESS = 15_000 // x4 6s
export const DELAY_SAVE_VIEWING_PROGRESS = 30_000 // x4 6s. old is 15s
export const DELAY_SAVE_HISTORY = 7_500 // 7.5s

export const TIMEOUT_GET_LAST_EP_VIEWING_IN_STORE = 5_000 // 5s

Expand Down

0 comments on commit 3d13b5f

Please sign in to comment.