mirror of
https://github.com/mii443/rs-docker-bot.git
synced 2025-08-23 00:25:30 +00:00
create ContaienrPool
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
mod config;
|
mod config;
|
||||||
|
mod container_pool;
|
||||||
mod docker;
|
mod docker;
|
||||||
mod event_handler;
|
mod event_handler;
|
||||||
mod language;
|
mod language;
|
||||||
@ -7,6 +8,7 @@ use std::{collections::HashSet, env, fs::File, io::Read, sync::Arc};
|
|||||||
|
|
||||||
use config::Config;
|
use config::Config;
|
||||||
|
|
||||||
|
use container_pool::ContainerPool;
|
||||||
use event_handler::event_handler;
|
use event_handler::event_handler;
|
||||||
use poise::{
|
use poise::{
|
||||||
serenity_prelude::{self as serenity, futures::lock::Mutex, UserId},
|
serenity_prelude::{self as serenity, futures::lock::Mutex, UserId},
|
||||||
@ -19,6 +21,7 @@ type Context<'a> = poise::Context<'a, Data, Error>;
|
|||||||
|
|
||||||
pub struct Data {
|
pub struct Data {
|
||||||
pub config: Arc<Mutex<Config>>,
|
pub config: Arc<Mutex<Config>>,
|
||||||
|
pub container_pool: Arc<Mutex<ContainerPool>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_config() -> Option<Config> {
|
fn load_config() -> Option<Config> {
|
||||||
@ -54,6 +57,7 @@ async fn main() -> Result<(), ()> {
|
|||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
Ok(Data {
|
Ok(Data {
|
||||||
config: Arc::new(Mutex::new(config)),
|
config: Arc::new(Mutex::new(config)),
|
||||||
|
container_pool: Arc::new(Mutex::new(ContainerPool::new())),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user