Skip to content

Commit

Permalink
small update
Browse files Browse the repository at this point in the history
  • Loading branch information
ksrichard committed Dec 10, 2024
1 parent 94598d0 commit fb1bf11
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use tari_dan_engine::function_definitions::FlowFunctionDefinition;
use tari_dan_storage::global::{DbTemplateType, DbTemplateUpdate, TemplateStatus};
use tari_engine_types::calculate_template_binary_hash;
use tari_shutdown::ShutdownSignal;
use tari_template_lib::{models::TemplateAddress, Hash};
use tari_template_lib::models::TemplateAddress;
use tari_validator_node_client::types::{ArgDef, FunctionDef, TemplateAbi};
use tokio::{
sync::{mpsc, mpsc::Receiver, oneshot},
Expand Down Expand Up @@ -67,8 +67,8 @@ impl<TAddr: NodeAddressable + 'static> TemplateManagerService<TAddr> {
download_queue,
completed_downloads,
}
.run(shutdown)
.await?;
.run(shutdown)
.await?;
Ok(())
})
}
Expand Down Expand Up @@ -131,10 +131,10 @@ impl<TAddr: NodeAddressable + 'static> TemplateManagerService<TAddr> {
self.handle_add_template(author_public_key, template_address, template, template_name)
.await,
);
},
}
GetTemplate { address, reply } => {
handle(reply, self.manager.fetch_template(&address));
},
}
GetTemplates { limit, reply } => handle(reply, self.manager.fetch_template_metadata(limit)),
LoadTemplateAbi { address, reply } => handle(reply, self.handle_load_template_abi(address)),
}
Expand Down Expand Up @@ -212,27 +212,27 @@ impl<TAddr: NodeAddressable + 'static> TemplateManagerService<TAddr> {
target: LOG_TARGET,
"⚠️ Template {} is not valid json: {}", download.template_address, e
);
},
}
};

DbTemplateUpdate {
flow_json: Some(String::from_utf8(bytes.to_vec())?),
status: Some(status),
..Default::default()
}
},
}
DbTemplateType::Manifest => todo!(),
};
self.manager.update_template(download.template_address, update)?;
},
}
Err(err) => {
warn!(target: LOG_TARGET, "🚨 Failed to download template: {}", err);
self.manager
.update_template(download.template_address, DbTemplateUpdate {
status: Some(TemplateStatus::DownloadFailed),
..Default::default()
})?;
},
}
}
Ok(())
}
Expand Down

0 comments on commit fb1bf11

Please sign in to comment.