commit a0459df

default  ·  2022-12-15 09:52:09 +0000 UTC
parent 4874134
Don't create a parent index if it already exists.
1 files changed,  +4, -2
M data.c
M data.c
+4, -2
 1@@ -531,9 +531,11 @@ int _object_add(const char *id, d_char *obj, int ow)
 2 
 3             /* create a one-element index with the parent */
 4             xs *p_idx = xs_replace(fn, ".json", "_p.idx");
 5-            index_add(p_idx, in_reply_to);
 6 
 7-            srv_debug(1, xs_fmt("object_add added parent %s to %s", in_reply_to, p_idx));
 8+            if (mtime(p_idx) == 0.0) {
 9+                index_add(p_idx, in_reply_to);
10+                srv_debug(1, xs_fmt("object_add added parent %s to %s", in_reply_to, p_idx));
11+            }
12         }
13     }
14     else