Skip to content

Commit

Permalink
add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
bristermitten committed Aug 24, 2023
1 parent e8834be commit d5e2ff8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/hotTakes/hotTakes.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import { readFileSync } from 'fs'
import ExpiryMap from 'expiry-map'

import { LRUCache } from 'lru-cache'
import { logger } from '../../logging.js'

const thingCache = new LRUCache<string, {}>({
max: 100,
max: 1000,
allowStale: false
})

Expand Down Expand Up @@ -149,6 +150,7 @@ function weightedRandom (weights: number[]) {

function getWeightedRandom (options: HotTakeThing[]): HotTakeThing {
const weights = createWeights(options)
logger.debug(`Weights: ${JSON.stringify(weights)}`)

const opt = weightedRandom(weights)
const val = options[opt]
Expand Down

0 comments on commit d5e2ff8

Please sign in to comment.