redis-manager-utils
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -482,2 +482,21 @@ const REDIS = require("redis"); | ||
nextInCircularSet( wKey , wAmount ) { | ||
if ( !wKey ) { return undefined; } | ||
wAmount = wAmount || 1; | ||
let that = this; | ||
return new Promise( async function( resolve , reject ) { | ||
try { | ||
let list = await that.setPopRandomMembers( wKey , 25 ); | ||
await Redis.setSetFromArray( RC.GENRES[ genre ].TRACKS + ".RECYCLED" , list ); | ||
if ( list.length < 1 ) { | ||
await Redis.setStoreUnion( RC.GENRES[ genre ].TRACKS , RC.GENRES[ genre ].TRACKS + ".RECYCLED" ); | ||
await Redis.keyDel( RC.GENRES[ genre ].TRACKS + ".RECYCLED" ); | ||
list = await Redis.setPopRandomMembers( RC.GENRES[ genre ].TRACKS , 25 ); | ||
} | ||
} | ||
catch( error ) { console.log( error ); reject( error ); } | ||
}); | ||
} | ||
// Adds an Array of Potential New Items to a set , | ||
@@ -484,0 +503,0 @@ // But compares them first to a filter set before adding |
{ | ||
"name": "redis-manager-utils", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20130
491