updated publish logging

This commit is contained in:
bill bittner 2017-06-30 17:28:53 -07:00
parent 8bf91368ef
commit 35f9551533
2 changed files with 7 additions and 2 deletions

View file

@ -8,8 +8,10 @@ function upsert (Model, values, condition) {
.findOne({ where: condition })
.then(function (obj) {
if (obj) { // update
logger.silly(`updating ${values.name}:${values.claimId} in File db`);
return obj.update(values);
} else { // insert
logger.silly(`creating ${values.name}:${values.claimId} in File db`);
return Model.create(values);
}
}).catch(function (error) {
@ -38,7 +40,10 @@ module.exports = {
fileType,
nsfw : publishParams.metadata.nsfw,
},
{ name: publishParams.name, claimId: result.claim_id }
{
name : publishParams.name,
claimId: result.claim_id,
}
).then(() => {
// resolve the promise with the result from lbryApi.publishClaim;
resolve(result);

View file

@ -75,7 +75,7 @@ function getClaimAndHandleResponse (uri, height, resolve, reject) {
.getClaim(uri)
.then(({ name, claim_id, outpoint, file_name, download_path, mime_type, metadata }) => {
// create entry in the db
logger.debug('creating new record in db');
logger.silly(`creating "${name}" record in File db`);
db.File
.create({
name,