Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
feat: respect cache_timeout setting
Browse files Browse the repository at this point in the history
  • Loading branch information
moranje committed Oct 10, 2018
1 parent 9f8679b commit bf18000
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/todoist/cache.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { CACHE_PATH } from '@/utils/references'
import { files } from '@/workflow/files'
import { getSettings } from '@/workflow/settings'
import LRU from 'lru-cache'
import writeJsonFile from 'write-json-file'

const options = {
max: 500,
maxAge: 1000 * 60 * 60 * 24 // A day
maxAge: 1000 * getSettings().cache_timeout
}
const cache = LRU(options)
cache.load(files.cache)
Expand Down
1 change: 1 addition & 0 deletions src/workflow/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface Settings {
language: string
max_items: number
uuid: string
cache_timeout: number
anonymous_statistics: boolean
}

Expand Down

0 comments on commit bf18000

Please sign in to comment.