mirror of
https://github.com/JHUAPL/kvspool.git
synced 2026-01-07 23:04:14 -05:00
fix outidx iteration and adjust internal rescan
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#define KVSPOOL_MAGIC "KV+SPOOL"
|
||||
|
||||
/* (reader): scan for new readable spools when > x seconds elapse */
|
||||
#define KVSPOOL_RESCAN_INTERVAL 10 /* seconds */
|
||||
#define KVSPOOL_RESCAN_INTERVAL 1 /* seconds */
|
||||
|
||||
/* (writer) attrition as needed to keep the total spool size approx under x */
|
||||
/* 1 GB is a default but this can be configured using the 'limits' file. */
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "utstring.h"
|
||||
#include "tpl.h"
|
||||
|
||||
#define INTERNAL_RESCAN_INTERVAL_SEC (10)
|
||||
#define INTERNAL_RESCAN_INTERVAL_SEC (1)
|
||||
|
||||
typedef struct {
|
||||
char *srpath; /* e.g. /tmp/myspool/spool.123456789.999-000.sr */
|
||||
|
||||
@@ -70,7 +70,7 @@ void mark_writable() {
|
||||
UT_string **s=NULL;
|
||||
while ( (fd=(int*)utarray_next(cfg.clients,fd))) {
|
||||
s=(UT_string**)utarray_next(cfg.outbufs,s); assert(s);
|
||||
i=(int*)utarray_next(cfg.outidxs,s); assert(i);
|
||||
i=(int*)utarray_next(cfg.outidxs,i); assert(i);
|
||||
if (utstring_len(*s) > *i) mod_epoll(EPOLLIN|EPOLLOUT, *fd);
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ void shift_buffers() {
|
||||
|
||||
while ( (fd=(int*)utarray_next(cfg.clients,fd))) {
|
||||
s=(UT_string**)utarray_next(cfg.outbufs,s); assert(s);
|
||||
i=(int*)utarray_next(cfg.outidxs,s); assert(i);
|
||||
i=(int*)utarray_next(cfg.outidxs,i); assert(i);
|
||||
len = utstring_len(*s);
|
||||
if (*i == 0) continue; // nothing to shift
|
||||
|
||||
|
||||
Reference in New Issue
Block a user