Skip to content

Commit

Permalink
fix(scheduler-utils): fix accidental change in scheduler utils
Browse files Browse the repository at this point in the history
  • Loading branch information
VinceJuliano committed Feb 9, 2024
1 parent b12602d commit 9118b1d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
22 changes: 18 additions & 4 deletions scheduler-utils/src/client/in-memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,29 @@ export function createLruCache ({ size }) {
}

export function getByProcessWith ({ cache = internalCache }) {
return async (processId) => {
return async (process) => {
if (!internalSize) return
return cache.get(processId)
return cache.get(process)
}
}

export function setByProcessWith ({ cache = internalCache }) {
return async (processId, processData) => {
return async (process, { url, address }, ttl) => {
if (!internalSize) return
return cache.set(processId, processData)
return cache.set(process, { url, address }, { ttl })
}
}

export function getByOwnerWith ({ cache = internalCache }) {
return async (owner) => {
if (!internalSize) return
return cache.get(owner)
}
}

export function setByOwnerWith ({ cache = internalCache }) {
return async (owner, url, ttl) => {
if (!internalSize) return
return cache.set(owner, { url, address: owner }, { ttl })
}
}
4 changes: 2 additions & 2 deletions servers/mu/src/domain/clients/in-memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export function getByProcessWith ({ cache = internalCache }) {
}

export function setByProcessWith ({ cache = internalCache }) {
return async (processId, processData, ttl) => {
return async (processId, processData) => {
if (!internalSize) return
return cache.set(processId, processData, { ttl })
return cache.set(processId, processData)
}
}

0 comments on commit 9118b1d

Please sign in to comment.