diff options
author | default <nobody@localhost> | 2022-11-28 08:34:19 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2022-11-28 08:34:19 +0100 |
commit | 9c136dacdf790fdfe30d1c48ad9b03add206bf73 (patch) | |
tree | 1cbedd8d0e88ad2c378b87a2dc81fd5da0d92ff3 /data.c | |
parent | 09d33b8e08a0b877761f5b1a901e2b4e765e0067 (diff) |
New function object_user_cache_in().
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -631,6 +631,16 @@ int object_user_cache_del(snac *snac, const char *id, const char *cachedir) } +int object_user_cache_in(snac *snac, const char *id, const char *cachedir) +/* checks if an object is stored in a cache */ +{ + xs *md5 = xs_md5_hex(id, strlen(id)); + xs *cfn = xs_fmt("%s/%s/%s.json", snac->basedir, cachedir, md5); + + return !!(mtime(cfn) != 0.0); +} + + /** specialized functions **/ d_char *_follower_fn(snac *snac, char *actor) |