cloud only needed to upload places

This commit is contained in:
Quaternions 2024-12-02 23:34:08 -08:00
parent 1124f8adea
commit 6c3942e37d
2 changed files with 2 additions and 6 deletions

View File

@ -17,16 +17,15 @@ impl std::error::Error for StartupError{}
#[tokio::main] #[tokio::main]
async fn main()->Result<(),StartupError>{ async fn main()->Result<(),StartupError>{
// cookies and clouds // talk to roblox
let cookie_context=rbx_asset::cookie::CookieContext::new(rbx_asset::cookie::Cookie::new("".to_owned())); let cookie_context=rbx_asset::cookie::CookieContext::new(rbx_asset::cookie::Cookie::new("".to_owned()));
let cloud_context=rbx_asset::cloud::CloudContext::new(rbx_asset::cloud::ApiKey::new("".to_owned()));
// nats // nats
let nasty=async_nats::connect("nats").await.map_err(StartupError::Connect)?; let nasty=async_nats::connect("nats").await.map_err(StartupError::Connect)?;
// connect to nats // connect to nats
let (publisher,validator)=tokio::try_join!( let (publisher,validator)=tokio::try_join!(
publisher::Publisher::new(nasty.clone(),cookie_context.clone(),cloud_context), publisher::Publisher::new(nasty.clone(),cookie_context.clone()),
validator::Validator::new(nasty,cookie_context) validator::Validator::new(nasty,cookie_context)
).map_err(StartupError::Subscribe)?; ).map_err(StartupError::Subscribe)?;

View File

@ -14,19 +14,16 @@ pub struct Publisher{
nats:async_nats::Client, nats:async_nats::Client,
subscriber:async_nats::Subscriber, subscriber:async_nats::Subscriber,
roblox_cookie:rbx_asset::cookie::CookieContext, roblox_cookie:rbx_asset::cookie::CookieContext,
roblox_cloud:rbx_asset::cloud::CloudContext,
} }
impl Publisher{ impl Publisher{
pub async fn new( pub async fn new(
nats:async_nats::Client, nats:async_nats::Client,
roblox_cookie:rbx_asset::cookie::CookieContext, roblox_cookie:rbx_asset::cookie::CookieContext,
roblox_cloud:rbx_asset::cloud::CloudContext,
)->Result<Self,async_nats::SubscribeError>{ )->Result<Self,async_nats::SubscribeError>{
Ok(Self{ Ok(Self{
subscriber:nats.subscribe("publish").await?, subscriber:nats.subscribe("publish").await?,
nats, nats,
roblox_cookie, roblox_cookie,
roblox_cloud,
}) })
} }
pub async fn run(mut self){ pub async fn run(mut self){