Skip to content

Commit

Permalink
Allow bots to upload 1GB of file data
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles committed Jan 1, 2025
1 parent 16dcdbe commit 4d5374f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion backend/canisters/user_index/impl/src/updates/register_bot.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
use crate::guards::caller_is_governance_principal;
use crate::model::user_map::Bot;
use crate::model::{MAX_AVATAR_SIZE, MAX_COMMANDS, MAX_DESCRIPTION_LEN};
use crate::{mutate_state, read_state, RuntimeState, USER_LIMIT};
use crate::{mutate_state, read_state, RuntimeState, ONE_GB, ONE_MB, USER_LIMIT};
use candid::Principal;
use canister_api_macros::{proposal, update};
use canister_tracing_macros::trace;
use event_store_producer::EventBuilder;
use local_user_index_canister::{BotRegistered, UserIndexEvent};
use rand::RngCore;
use storage_index_canister::add_or_update_users::UserConfig;
use tracing::error;
use types::{UserId, UserType};
use url::Url;
Expand Down Expand Up @@ -89,6 +90,14 @@ fn register_bot_impl(args: Args, state: &mut RuntimeState) {
None,
);

state.data.storage_index_user_sync_queue.push(
state.data.storage_index_canister_id,
UserConfig {
user_id: args.principal,
byte_limit: ONE_GB,
},
);

state.data.event_store_client.push(
EventBuilder::new("user_registered", now)
.with_user(user_id.to_string(), true)
Expand Down

0 comments on commit 4d5374f

Please sign in to comment.