UNPKG

396 BJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.expire = expire;
7
8var _keyspaceNotifications = require('../keyspace-notifications');
9
10function expire(key, seconds) {
11 if (!this.data.has(key)) {
12 return 0;
13 }
14
15 this.expires.set(key, seconds * 1000 + Date.now());
16 (0, _keyspaceNotifications.emitNotification)(this, 'g', key, 'expire');
17
18 return 1;
19}
\No newline at end of file