Browse Source

Use the more generic ckmsg_t for the json_lists

master
Con Kolivas 10 years ago
parent
commit
3047ee5c8f
  1. 16
      src/stratifier.c

16
src/stratifier.c

@ -366,14 +366,6 @@ struct stratifier_data {
typedef struct stratifier_data sdata_t; typedef struct stratifier_data sdata_t;
typedef struct json_entry json_entry_t;
struct json_entry {
json_entry_t *next;
json_entry_t *prev;
json_t *val;
};
/* Priority levels for generator messages */ /* Priority levels for generator messages */
#define GEN_LAX 0 #define GEN_LAX 0
#define GEN_NORMAL 1 #define GEN_NORMAL 1
@ -3860,7 +3852,7 @@ out:
* avoid floods of stat data coming at once. */ * avoid floods of stat data coming at once. */
static void update_workerstats(ckpool_t *ckp, sdata_t *sdata) static void update_workerstats(ckpool_t *ckp, sdata_t *sdata)
{ {
json_entry_t *json_list = NULL, *entry, *tmpentry; ckmsg_t *json_list = NULL, *entry, *tmpentry;
user_instance_t *user, *tmp; user_instance_t *user, *tmp;
char cdfield[64]; char cdfield[64];
time_t now_t; time_t now_t;
@ -3921,8 +3913,8 @@ static void update_workerstats(ckpool_t *ckp, sdata_t *sdata)
"createcode", __func__, "createcode", __func__,
"createinet", ckp->serverurl[0]); "createinet", ckp->serverurl[0]);
worker->notified_idle = worker->idle; worker->notified_idle = worker->idle;
entry = ckalloc(sizeof(json_entry_t)); entry = ckalloc(sizeof(ckmsg_t));
entry->val = val; entry->data = val;
DL_APPEND(json_list, entry); DL_APPEND(json_list, entry);
} }
} }
@ -3930,7 +3922,7 @@ static void update_workerstats(ckpool_t *ckp, sdata_t *sdata)
/* Add all entries outside of the instance lock */ /* Add all entries outside of the instance lock */
DL_FOREACH_SAFE(json_list, entry, tmpentry) { DL_FOREACH_SAFE(json_list, entry, tmpentry) {
ckdbq_add(ckp, ID_WORKERSTATS, entry->val); ckdbq_add(ckp, ID_WORKERSTATS, (json_t *)entry->data);
DL_DELETE(json_list, entry); DL_DELETE(json_list, entry);
free(entry); free(entry);
} }

Loading…
Cancel
Save