Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
43574a72
Commit
43574a72
authored
Jan 07, 2011
by
antirez
Browse files
avoid bgsaving temp files
parent
f03fe802
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/diskstore.c
View file @
43574a72
...
...
@@ -190,7 +190,7 @@ int dsSet(redisDb *db, robj *key, robj *val) {
len
=
dsKeyToPath
(
db
,
buf
,
key
);
memcpy
(
buf2
,
buf
,
len
);
snprintf
(
buf2
+
len
,
sizeof
(
buf2
)
-
len
,
"
_
%ld
_
%ld"
,(
long
)
time
(
NULL
),(
long
)
val
);
snprintf
(
buf2
+
len
,
sizeof
(
buf2
)
-
len
,
"
-
%ld
-
%ld"
,(
long
)
time
(
NULL
),(
long
)
val
);
while
((
fp
=
fopen
(
buf2
,
"w"
))
==
NULL
)
{
if
(
errno
==
ENOSPC
)
{
redisLog
(
REDIS_WARNING
,
"Diskstore: No space left on device. Please make room and wait 30 seconds for Redis to continue."
);
...
...
@@ -401,6 +401,8 @@ void *dsRdbSave_thread(void *arg) {
readdir_r
(
dir
,
&
de
,
&
dp
);
if
(
dp
==
NULL
)
break
;
if
(
dp
->
d_name
[
0
]
==
'.'
)
continue
;
/* If there is a '-' char in the file name, it's a temp file */
if
(
strchr
(
dp
->
d_name
,
'-'
)
!=
NULL
)
continue
;
/* Emit the SELECT DB opcode if needed. */
dbid
=
dsGetDbidFromFilename
(
dp
->
d_name
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment