mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
Merge pull request #5095 from 0xtonyxia/fix-indentation
Fix indentation.
This commit is contained in:
commit
7239e9ca5f
4
src/ae.c
4
src/ae.c
@ -433,7 +433,7 @@ int aeProcessEvents(aeEventLoop *eventLoop, int flags)
|
|||||||
* before replying to a client. */
|
* before replying to a client. */
|
||||||
int invert = fe->mask & AE_BARRIER;
|
int invert = fe->mask & AE_BARRIER;
|
||||||
|
|
||||||
/* Note the "fe->mask & mask & ..." code: maybe an already
|
/* Note the "fe->mask & mask & ..." code: maybe an already
|
||||||
* processed event removed an element that fired and we still
|
* processed event removed an element that fired and we still
|
||||||
* didn't processed, so we check if the event is still valid.
|
* didn't processed, so we check if the event is still valid.
|
||||||
*
|
*
|
||||||
@ -485,7 +485,7 @@ int aeWait(int fd, int mask, long long milliseconds) {
|
|||||||
if ((retval = poll(&pfd, 1, milliseconds))== 1) {
|
if ((retval = poll(&pfd, 1, milliseconds))== 1) {
|
||||||
if (pfd.revents & POLLIN) retmask |= AE_READABLE;
|
if (pfd.revents & POLLIN) retmask |= AE_READABLE;
|
||||||
if (pfd.revents & POLLOUT) retmask |= AE_WRITABLE;
|
if (pfd.revents & POLLOUT) retmask |= AE_WRITABLE;
|
||||||
if (pfd.revents & POLLERR) retmask |= AE_WRITABLE;
|
if (pfd.revents & POLLERR) retmask |= AE_WRITABLE;
|
||||||
if (pfd.revents & POLLHUP) retmask |= AE_WRITABLE;
|
if (pfd.revents & POLLHUP) retmask |= AE_WRITABLE;
|
||||||
return retmask;
|
return retmask;
|
||||||
} else {
|
} else {
|
||||||
|
22
src/server.c
22
src/server.c
@ -1165,7 +1165,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
|
|||||||
} else {
|
} else {
|
||||||
/* If there is not a background saving/rewrite in progress check if
|
/* If there is not a background saving/rewrite in progress check if
|
||||||
* we have to save/rewrite now. */
|
* we have to save/rewrite now. */
|
||||||
for (j = 0; j < server.saveparamslen; j++) {
|
for (j = 0; j < server.saveparamslen; j++) {
|
||||||
struct saveparam *sp = server.saveparams+j;
|
struct saveparam *sp = server.saveparams+j;
|
||||||
|
|
||||||
/* Save if we reached the given amount of changes,
|
/* Save if we reached the given amount of changes,
|
||||||
@ -1185,23 +1185,23 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
|
|||||||
rdbSaveBackground(server.rdb_filename,rsiptr);
|
rdbSaveBackground(server.rdb_filename,rsiptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Trigger an AOF rewrite if needed. */
|
/* Trigger an AOF rewrite if needed. */
|
||||||
if (server.aof_state == AOF_ON &&
|
if (server.aof_state == AOF_ON &&
|
||||||
server.rdb_child_pid == -1 &&
|
server.rdb_child_pid == -1 &&
|
||||||
server.aof_child_pid == -1 &&
|
server.aof_child_pid == -1 &&
|
||||||
server.aof_rewrite_perc &&
|
server.aof_rewrite_perc &&
|
||||||
server.aof_current_size > server.aof_rewrite_min_size)
|
server.aof_current_size > server.aof_rewrite_min_size)
|
||||||
{
|
{
|
||||||
long long base = server.aof_rewrite_base_size ?
|
long long base = server.aof_rewrite_base_size ?
|
||||||
server.aof_rewrite_base_size : 1;
|
server.aof_rewrite_base_size : 1;
|
||||||
long long growth = (server.aof_current_size*100/base) - 100;
|
long long growth = (server.aof_current_size*100/base) - 100;
|
||||||
if (growth >= server.aof_rewrite_perc) {
|
if (growth >= server.aof_rewrite_perc) {
|
||||||
serverLog(LL_NOTICE,"Starting automatic rewriting of AOF on %lld%% growth",growth);
|
serverLog(LL_NOTICE,"Starting automatic rewriting of AOF on %lld%% growth",growth);
|
||||||
rewriteAppendOnlyFileBackground();
|
rewriteAppendOnlyFileBackground();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user