mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-11 21:26:20 +00:00
Don't log an error when MDP fetch fails due to missing bundle
This commit is contained in:
parent
096c9670ca
commit
63226143ac
@ -1169,11 +1169,16 @@ int rhizome_database_filehash_from_id(const rhizome_bid_t *bidp, uint64_t versio
|
|||||||
{
|
{
|
||||||
IN();
|
IN();
|
||||||
strbuf hash_sb = strbuf_alloca(RHIZOME_FILEHASH_STRLEN + 1);
|
strbuf hash_sb = strbuf_alloca(RHIZOME_FILEHASH_STRLEN + 1);
|
||||||
if ( sqlite_exec_strbuf(hash_sb, "SELECT filehash FROM MANIFESTS WHERE version = ? AND id = ?;",
|
int r = sqlite_exec_strbuf(hash_sb, "SELECT filehash FROM MANIFESTS WHERE version = ? AND id = ?;",
|
||||||
INT64, version, RHIZOME_BID_T, bidp, END) == -1)
|
INT64, version, RHIZOME_BID_T, bidp, END);
|
||||||
|
if (r == -1)
|
||||||
RETURN(-1);
|
RETURN(-1);
|
||||||
|
// this bundle / version was not found
|
||||||
|
if (r != 1)
|
||||||
|
RETURN(1);
|
||||||
if (strbuf_overrun(hash_sb) || str_to_rhizome_filehash_t(hashp, strbuf_str(hash_sb)) == -1)
|
if (strbuf_overrun(hash_sb) || str_to_rhizome_filehash_t(hashp, strbuf_str(hash_sb)) == -1)
|
||||||
RETURN(WHYF("malformed file hash for bid=%s version=%"PRIu64, alloca_tohex_rhizome_bid_t(*bidp), version));
|
RETURN(WHYF("malformed file hash (%s) for bid=%s version=%"PRIu64,
|
||||||
|
strbuf_str(hash_sb), alloca_tohex_rhizome_bid_t(*bidp), version));
|
||||||
RETURN(0);
|
RETURN(0);
|
||||||
OUT();
|
OUT();
|
||||||
}
|
}
|
||||||
|
@ -1358,8 +1358,12 @@ ssize_t rhizome_read_cached(const rhizome_bid_t *bidp, uint64_t version, time_ms
|
|||||||
// if we don't have one yet, create one and open it
|
// if we don't have one yet, create one and open it
|
||||||
if (!entry){
|
if (!entry){
|
||||||
rhizome_filehash_t filehash;
|
rhizome_filehash_t filehash;
|
||||||
if (rhizome_database_filehash_from_id(bidp, version, &filehash) == -1)
|
if (rhizome_database_filehash_from_id(bidp, version, &filehash) != 0){
|
||||||
|
if (config.debug.rhizome_store)
|
||||||
|
DEBUGF("Payload not found for bundle bid=%s version=%"PRIu64,
|
||||||
|
alloca_tohex_rhizome_bid_t(*bidp), version);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
entry = emalloc_zero(sizeof(struct cache_entry));
|
entry = emalloc_zero(sizeof(struct cache_entry));
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user