snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit a0459df6ea4f4639693459dfa01564d9aa6fd0ce
parent 48741349140e8c23ddb2d451f188d71c5e03db3e
Author: default <nobody@localhost>
Date:   Thu, 15 Dec 2022 10:52:09 +0100

Don't create a parent index if it already exists.

Diffstat:
Mdata.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/data.c b/data.c @@ -531,9 +531,11 @@ int _object_add(const char *id, d_char *obj, int ow) /* create a one-element index with the parent */ xs *p_idx = xs_replace(fn, ".json", "_p.idx"); - index_add(p_idx, in_reply_to); - srv_debug(1, xs_fmt("object_add added parent %s to %s", in_reply_to, p_idx)); + if (mtime(p_idx) == 0.0) { + index_add(p_idx, in_reply_to); + srv_debug(1, xs_fmt("object_add added parent %s to %s", in_reply_to, p_idx)); + } } } else