mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-26 01:03:37 +00:00
New function srv_archive_qitem().
This commit is contained in:
parent
ad718e5b80
commit
f8196b4ef6
3 changed files with 18 additions and 1 deletions
|
@ -2135,8 +2135,10 @@ void process_queue_item(xs_dict *q_item)
|
|||
|
||||
unlink(tmpfn);
|
||||
|
||||
if (cnt == 0)
|
||||
if (cnt == 0) {
|
||||
srv_archive_qitem(q_item);
|
||||
srv_debug(1, xs_fmt("no valid recipients for %s", tmpfn));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
14
data.c
14
data.c
|
@ -2752,3 +2752,17 @@ void srv_archive_error(const char *prefix, const xs_str *err,
|
|||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void srv_archive_qitem(xs_dict *q_item)
|
||||
/* archives a q_item in the error folder */
|
||||
{
|
||||
xs *ntid = tid(0);
|
||||
xs *fn = xs_fmt("%s/error/%s_qitem", srv_basedir, ntid);
|
||||
FILE *f;
|
||||
|
||||
if ((f = fopen(fn, "w")) != NULL) {
|
||||
xs_json_dump(q_item, 4, f);
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
|
1
snac.h
1
snac.h
|
@ -64,6 +64,7 @@ void srv_archive(const char *direction, const char *url, xs_dict *req,
|
|||
const char *body, int b_size);
|
||||
void srv_archive_error(const char *prefix, const xs_str *err,
|
||||
const xs_dict *req, const xs_val *data);
|
||||
void srv_archive_qitem(xs_dict *q_item);
|
||||
|
||||
double mtime_nl(const char *fn, int *n_link);
|
||||
#define mtime(fn) mtime_nl(fn, NULL)
|
||||
|
|
Loading…
Reference in a new issue