Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加 timeout 选项和相应的 renew, keys 接口 #2

Merged
merged 1 commit into from
May 4, 2017

Conversation

viemacs
Copy link
Contributor

@viemacs viemacs commented May 3, 2017

  1. Redis 使用 timeout (TTL) 选项时, table_name 需设置为空字符串 ""
  2. LevelDB 和 object/Map 现不支持 keys(), 无返回结果

@@ -2,7 +2,7 @@ var utils = require('../utils');

function getTable(conn, opts) {
var name = utils.table_name(opts);
return name ? conn.getHash(name) : conn;
return !name || name === 'kvs' ? conn : conn.getHash(name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redis 时可以在 setup 时有 timeout 且 name 不为 '' 时抛出错误。强制要求将 name 设置为 '',
这样可以避免程序员错误设置参数。同时也可以减少下面代码的复杂性。

@xicilion
Copy link
Member

xicilion commented May 3, 2017

要把 readme 修改一下

@viemacs viemacs changed the title 增加 timeout 选项和相应的 renew, cleanup, keys 接口 增加 timeout 选项和相应的 renew, keys 接口 May 3, 2017
@viemacs viemacs force-pushed the f_expire branch 6 times, most recently from 460aaf4 to 88b4023 Compare May 3, 2017 12:50
@xicilion xicilion merged commit 5e97336 into fibjs:master May 4, 2017
utils.key_name(opts) + ' VARCHAR(' + utils.key_size(opts) + ') PRIMARY KEY, ' +
utils.value_name(opts) + ' VARCHAR(' + utils.value_size(opts) + '));';
utils.value_name(opts) + ' VARCHAR(' + utils.value_size(opts) + ')' +
_v(opts, ', _timestamp BIGINT') + ');';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timestamp 改为 _timestamp; 在 timeout 不为正时, 不加 时间戳 字段. 以减少冲突的可能.

@viemacs
Copy link
Contributor Author

viemacs commented May 4, 2017

在 sqlite, mysql, mongodb 上有增加时间戳的问题. 对 sqlite, mysql 预先定义好的表, 如果开 timeout 需要在实现上再处理一下.

@viemacs viemacs deleted the f_expire branch May 4, 2017 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants