mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
In _timeline_write(), limit the number of grampa levels updated.
This commit is contained in:
parent
c78574c8d9
commit
bf214d45e9
1 changed files with 9 additions and 0 deletions
9
data.c
9
data.c
|
@ -517,6 +517,8 @@ int _timeline_write(snac *snac, char *id, char *msg, char *parent, char *referre
|
|||
/* now iterate all parents up, just renaming the files */
|
||||
xs *grampa = xs_dup(xs_dict_get(meta, "parent"));
|
||||
|
||||
int max_levels = 10;
|
||||
|
||||
while (!xs_is_null(grampa)) {
|
||||
xs *gofn = _timeline_find_fn(snac, grampa);
|
||||
|
||||
|
@ -555,6 +557,13 @@ int _timeline_write(snac *snac, char *id, char *msg, char *parent, char *referre
|
|||
xs_free(grampa);
|
||||
grampa = xs_dup(p);
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
if (--max_levels == 0) {
|
||||
snac_log(snac, xs_dup("_timeline_write maximum grampa levels reached"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue