mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-10 03:50:38 +03:00
Don't create a parent index if it already exists.
This commit is contained in:
parent
4874134914
commit
a0459df6ea
4
data.c
4
data.c
@ -531,11 +531,13 @@ int _object_add(const char *id, d_char *obj, int ow)
|
|||||||
|
|
||||||
/* create a one-element index with the parent */
|
/* create a one-element index with the parent */
|
||||||
xs *p_idx = xs_replace(fn, ".json", "_p.idx");
|
xs *p_idx = xs_replace(fn, ".json", "_p.idx");
|
||||||
index_add(p_idx, in_reply_to);
|
|
||||||
|
|
||||||
|
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));
|
srv_debug(1, xs_fmt("object_add added parent %s to %s", in_reply_to, p_idx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
status = 500;
|
status = 500;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user