Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hanoi2005
redis
提交
1b677732
R
redis
项目概览
hanoi2005
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1b677732
编写于
5月 10, 2010
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CONFIG now can change appendfsync policy at run time
上级
a34e0a25
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
1 deletion
+28
-1
redis.c
redis.c
+24
-1
redis.conf
redis.conf
+4
-0
未找到文件。
redis.c
浏览文件 @
1b677732
...
@@ -1635,7 +1635,7 @@ static void initServerConfig() {
...
@@ -1635,7 +1635,7 @@ static void initServerConfig() {
server
.
glueoutputbuf
=
1
;
server
.
glueoutputbuf
=
1
;
server
.
daemonize
=
0
;
server
.
daemonize
=
0
;
server
.
appendonly
=
0
;
server
.
appendonly
=
0
;
server
.
appendfsync
=
APPENDFSYNC_
ALWAYS
;
server
.
appendfsync
=
APPENDFSYNC_
EVERYSEC
;
server
.
lastfsync
=
time
(
NULL
);
server
.
lastfsync
=
time
(
NULL
);
server
.
appendfd
=
-
1
;
server
.
appendfd
=
-
1
;
server
.
appendseldb
=
-
1
;
/* Make sure the first time will not match */
server
.
appendseldb
=
-
1
;
/* Make sure the first time will not match */
...
@@ -9683,6 +9683,16 @@ static void configSetCommand(redisClient *c) {
...
@@ -9683,6 +9683,16 @@ static void configSetCommand(redisClient *c) {
server
.
masterauth
=
zstrdup
(
o
->
ptr
);
server
.
masterauth
=
zstrdup
(
o
->
ptr
);
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"maxmemory"
))
{
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"maxmemory"
))
{
server
.
maxmemory
=
strtoll
(
o
->
ptr
,
NULL
,
10
);
server
.
maxmemory
=
strtoll
(
o
->
ptr
,
NULL
,
10
);
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"appendfsync"
))
{
if
(
!
strcasecmp
(
o
->
ptr
,
"no"
))
{
server
.
appendfsync
=
APPENDFSYNC_NO
;
}
else
if
(
!
strcasecmp
(
o
->
ptr
,
"everysec"
))
{
server
.
appendfsync
=
APPENDFSYNC_EVERYSEC
;
}
else
if
(
!
strcasecmp
(
o
->
ptr
,
"always"
))
{
server
.
appendfsync
=
APPENDFSYNC_ALWAYS
;
}
else
{
goto
badfmt
;
}
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"save"
))
{
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"save"
))
{
int
vlen
,
j
;
int
vlen
,
j
;
sds
*
v
=
sdssplitlen
(
o
->
ptr
,
sdslen
(
o
->
ptr
),
" "
,
1
,
&
vlen
);
sds
*
v
=
sdssplitlen
(
o
->
ptr
,
sdslen
(
o
->
ptr
),
" "
,
1
,
&
vlen
);
...
@@ -9768,6 +9778,19 @@ static void configGetCommand(redisClient *c) {
...
@@ -9768,6 +9778,19 @@ static void configGetCommand(redisClient *c) {
addReplyBulkCString
(
c
,
buf
);
addReplyBulkCString
(
c
,
buf
);
matches
++
;
matches
++
;
}
}
if
(
stringmatch
(
pattern
,
"appendfsync"
,
0
))
{
char
*
policy
;
switch
(
server
.
appendfsync
)
{
case
APPENDFSYNC_NO
:
policy
=
"no"
;
break
;
case
APPENDFSYNC_EVERYSEC
:
policy
=
"everysec"
;
break
;
case
APPENDFSYNC_ALWAYS
:
policy
=
"always"
;
break
;
default:
policy
=
"unknown"
;
break
;
/* too harmless to panic */
}
addReplyBulkCString
(
c
,
"appendfsync"
);
addReplyBulkCString
(
c
,
policy
);
matches
++
;
}
if
(
stringmatch
(
pattern
,
"save"
,
0
))
{
if
(
stringmatch
(
pattern
,
"save"
,
0
))
{
sds
buf
=
sdsempty
();
sds
buf
=
sdsempty
();
int
j
;
int
j
;
...
...
redis.conf
浏览文件 @
1b677732
...
@@ -112,6 +112,10 @@ dir ./
...
@@ -112,6 +112,10 @@ dir ./
#
#
# This should stay commented out for backward compatibility and because most
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
# people do not need auth (e.g. they run their own servers).
#
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
#
#
# requirepass foobared
# requirepass foobared
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录