New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@acuris/leprechaun-cache

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acuris/leprechaun-cache - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

LICENSE

16

dist/leprechaun-cache.js

@@ -33,3 +33,3 @@ "use strict";

try {
promise = this.doGet(this.keyPrefix + key, ttlInMilliseconds);
promise = this.doGet(key, ttlInMilliseconds);
this.inProgress.set(key, promise);

@@ -45,3 +45,3 @@ return await promise;

async doGet(key, ttl) {
const result = await this.cacheStore.get(key);
const result = await this.cacheStore.get(this.keyPrefix + key);
if (!result) {

@@ -68,3 +68,3 @@ return this.updateCache(key, ttl, true);

do {
lock.lockId = (await this.cacheStore.lock(key, this.lockTTL)) || '';
lock.lockId = (await this.cacheStore.lock(this.keyPrefix + key, this.lockTTL)) || '';
if (lock.lockId) {

@@ -82,3 +82,3 @@ break;

: {
lockId: (await this.cacheStore.lock(key, this.lockTTL)) || '',
lockId: (await this.cacheStore.lock(this.keyPrefix + key, this.lockTTL)) || '',
didSpin: false

@@ -94,5 +94,5 @@ };

//If we spun while getting the lock, then get the updated version (hopefully updated by another process)
const result = await this.cacheStore.get(key);
const result = await this.cacheStore.get(this.keyPrefix + key);
if (result && result.data) {
await this.cacheStore.unlock(key, lock.lockId);
await this.cacheStore.unlock(this.keyPrefix + key, lock.lockId);
return result.data;

@@ -111,3 +111,3 @@ }

try {
await this.cacheStore.set(key, cacheData, this.hardTTL);
await this.cacheStore.set(this.keyPrefix + key, cacheData, this.hardTTL);
}

@@ -119,3 +119,3 @@ catch (e) {

try {
await this.cacheStore.unlock(key, lock.lockId);
await this.cacheStore.unlock(this.keyPrefix + key, lock.lockId);
}

@@ -122,0 +122,0 @@ catch (e) {

{
"name": "@acuris/leprechaun-cache",
"version": "0.0.3",
"version": "0.0.4",
"private": false,

@@ -5,0 +5,0 @@ "description": "Caching library that supports double checked caching and stale returns to avoid stampede and slow responses",

@@ -62,3 +62,3 @@ import { CacheStore, Cacheable, OnCacheMiss, LeprechaunCacheOptions, CacheItem } from './types'

try {
promise = this.doGet(this.keyPrefix + key, ttlInMilliseconds)
promise = this.doGet(key, ttlInMilliseconds)
this.inProgress.set(key, promise)

@@ -74,3 +74,3 @@ return await promise

private async doGet(key: string, ttl: number): Promise<T> {
const result = await this.cacheStore.get(key)
const result = await this.cacheStore.get(this.keyPrefix + key)
if (!result) {

@@ -97,3 +97,3 @@ return this.updateCache(key, ttl, true)

do {
lock.lockId = (await this.cacheStore.lock(key, this.lockTTL)) || ''
lock.lockId = (await this.cacheStore.lock(this.keyPrefix + key, this.lockTTL)) || ''
if (lock.lockId) {

@@ -112,3 +112,3 @@ break

: {
lockId: (await this.cacheStore.lock(key, this.lockTTL)) || '',
lockId: (await this.cacheStore.lock(this.keyPrefix + key, this.lockTTL)) || '',
didSpin: false

@@ -127,5 +127,5 @@ }

//If we spun while getting the lock, then get the updated version (hopefully updated by another process)
const result = await this.cacheStore.get(key)
const result = await this.cacheStore.get(this.keyPrefix + key)
if (result && result.data) {
await this.cacheStore.unlock(key, lock.lockId)
await this.cacheStore.unlock(this.keyPrefix + key, lock.lockId)
return result.data

@@ -152,3 +152,3 @@ }

try {
await this.cacheStore.set(key, cacheData, this.hardTTL)
await this.cacheStore.set(this.keyPrefix + key, cacheData, this.hardTTL)
} catch (e) {

@@ -159,3 +159,3 @@ this.onBackgroundError(e)

try {
await this.cacheStore.unlock(key, lock.lockId)
await this.cacheStore.unlock(this.keyPrefix + key, lock.lockId)
} catch (e) {

@@ -162,0 +162,0 @@ this.onBackgroundError(e)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc