Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "core/cache"

Index

Variables

Let Cache

Cache: any = NodeCache

Const articlesTtl

articlesTtl: number = 24 * 60 * 3600

Const entryImportTtl

entryImportTtl: number = 3 * 60

Const eventsTtl

eventsTtl: number = 24 * 60 * 3600

Const generalTtl

generalTtl: number = 24 * 60 * 3600

Const settingsTtl

settingsTtl: number = 24 * 60 * 3600

Const usersTtl

usersTtl: number = 10 * 60

Functions

getOrFetch

  • getOrFetch<T>(cache: NodeCache, key: string, asyncFetch: function, ttl?: number): Promise<T>
  • Type parameters

    • T

    Parameters

    • cache: NodeCache
    • key: string
    • asyncFetch: function
        • (): Promise<T>
        • Returns Promise<T>

    • Optional ttl: number

    Returns Promise<T>

user

  • user(userModel: any): NodeCache
  • Provides access to the cache for user information

    Parameters

    • userModel: any

      User model, or directly the user name

    Returns NodeCache

    cache

Object literals

Const cacheMap

cacheMap: object

articles

articles: NodeCache = new Cache({ stdTTL: articlesTtl }) as NodeCache

entryImport

entryImport: NodeCache = new Cache({ stdTTL: entryImportTtl }) as NodeCache

eventsById

eventsById: NodeCache = new Cache({ stdTTL: eventsTtl }) as NodeCache

eventsByName

eventsByName: NodeCache = new Cache({ stdTTL: eventsTtl }) as NodeCache

general

general: NodeCache = new Cache({ stdTTL: generalTtl }) as NodeCache

settings

settings: NodeCache = new Cache({ stdTTL: settingsTtl }) as NodeCache

users

users: NodeCache = new Cache({ stdTTL: usersTtl }) as NodeCache

Generated using TypeDoc