diff options
| author | 2022-12-15 10:52:09 +0100 | |
|---|---|---|
| committer | 2022-12-15 10:52:09 +0100 | |
| commit | a0459df6ea4f4639693459dfa01564d9aa6fd0ce (patch) | |
| tree | 06d12923c72bb6a600537c7c2d5a813202e09e46 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | penes-snac2-a0459df6ea4f4639693459dfa01564d9aa6fd0ce.tar.gz penes-snac2-a0459df6ea4f4639693459dfa01564d9aa6fd0ce.tar.xz penes-snac2-a0459df6ea4f4639693459dfa01564d9aa6fd0ce.zip | |
Don't create a parent index if it already exists.
| -rw-r--r-- | data.c | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -531,9 +531,11 @@ int _object_add(const char *id, d_char *obj, int ow) | |||
| 531 | 531 | ||
| 532 | /* create a one-element index with the parent */ | 532 | /* create a one-element index with the parent */ |
| 533 | xs *p_idx = xs_replace(fn, ".json", "_p.idx"); | 533 | xs *p_idx = xs_replace(fn, ".json", "_p.idx"); |
| 534 | index_add(p_idx, in_reply_to); | ||
| 535 | 534 | ||
| 536 | srv_debug(1, xs_fmt("object_add added parent %s to %s", in_reply_to, p_idx)); | 535 | if (mtime(p_idx) == 0.0) { |
| 536 | index_add(p_idx, in_reply_to); | ||
| 537 | srv_debug(1, xs_fmt("object_add added parent %s to %s", in_reply_to, p_idx)); | ||
| 538 | } | ||
| 537 | } | 539 | } |
| 538 | } | 540 | } |
| 539 | else | 541 | else |