UNPKG

@silverwind/ioredis-mock

Version:

This library emulates ioredis by performing all operations in-memory.

18 lines (14 loc) 395 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.expire = expire; var _keyspaceNotifications = require("../keyspace-notifications"); function expire(key, seconds) { if (!this.data.has(key)) { return 0; } this.expires.set(key, seconds * 1000 + Date.now()); (0, _keyspaceNotifications.emitNotification)(this, 'g', key, 'expire'); return 1; }