Tags: Kitt3120/lum
Tags
Update sqlx requirement from 0.7.3 to 0.8.0 (#49) * Bump main to staging (#7) * Setup (#1) - Add tokio, serde and sqlx crates - Setup .gitignore - Setup Cargo.toml - Setup pipelines * Enable Dependabot (#3) Add dependabot.yml with daily cargo updates configured * Fix staging pipelines (#4) Fix staging pipelines not triggering on pull request * Implement Cargo caching (#5) Add Swatinem's Rust-Cache@v2 action to build, test and deploy pipelines * Improve README.md (#6) - Add deployment badges - Add collaborating info (board + issues) * Update sqlx requirement from 0.7.3 to 0.8.0 Updates the requirements on [sqlx](https://github.com/launchbadge/sqlx) to permit the latest version. - [Changelog](https://github.com/launchbadge/sqlx/blob/main/CHANGELOG.md) - [Commits](launchbadge/sqlx@v0.7.3...v0.8.0) --- updated-dependencies: - dependency-name: sqlx dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * remove: empty line --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Torben Schweren <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add Devcontainer (#40) * added devcontainer added postgresql and some nice to have extensions * removed clang to fix pipelines * Update .devcontainer/devcontainer.json Co-authored-by: Torben Schweren <[email protected]> * Update .devcontainer/docker-compose.yml Co-authored-by: Torben Schweren <[email protected]> --------- Co-authored-by: Torben Schweren <[email protected]>
Service framework background tasks and watchdogs (#39) * Service framework background task - Implement an optional background task for services that starts automatically on service start. - Implement a watchdog that updates the service's status when its task fails at runtime * WIP: Partially implemented - Background task startup + watchdog implemented for service startup - Implementation for service shutdown missing - Handling of watchdog triggers of essential tasks missing * Refactor of service framework Split service framework into multiple submodules * Implement Watchdog module * Optimize Watchdog module Make usage of Watchdog more flexible * Refactor start_service Refactor the giant block of cod e into smaller helper methods where possible * Edit StartupError string representations * Finish refactor of start_service method * Refactor stop_service - Apply same refactoring to stop_service - Increase name placeholder space to 30 in logger
Implement service startup/shutdown timeout (#33) - Add hardcoded timeout of 10 seconds on service startup - Add hardcoded timeout of 10 seconds on service shutdown - Remove timeout implementation of Discord service, as it is now handled by the Service Manager.
Refactor service framework (#25) * Service framework improvements - Way better handling of mutable/immutable attributes - Less Mutexes - Better handling of passing references through the service framework's API - Reimplement get_service accepting a TypeId as a generic parameter for easier usage - Reimplement status_map and status_tree as a result of the above adaptations, resulting in way simpler versions * More service framework improvements - Replace all Mutexes with RwLock - Remove status_map method of ServiceManager - Services vector in ServiceManager now wraps the Service trait objects in a RwLock to potentially make them available mutably through the public API of ServiceManager * Implement get_service<T> method - Add downcast-rs crate - Implement get_service<T> method of ServiceManager Had to use unsafe Rust for this. Tried it with safe Rust for 3 days and couldn't do it. With unsafe Rust, it's very easy. It's also still kinda safe, as the crash case is checked and prevented before going into the unsafe block. * Finish refactor of service framework - ServiceManager now holds an Arc to itself - Self-Arc is now passed to services when initializing them, so they can access other services and copy Arcs to those for themselves - Implement SetLock<T> struct which is a wrapper around Option<T> for lazy-initialization - ServiceManagerBuilder handles the creation and injection of the Self-Arc of ServiceManager. That's why the build() method is now async and the From trait had to be removed. The From trait cannot be implemented async. - To keep everything consistent, the From trait has also been removed from the BotBuilder and the build() method becase async. * Adapt Discord service - Adapt Discord service to new service framework and SetLock type
Feature/discord service (#24) * Add serenity Add serenity as a dependency and use some extra features and the native TLS backend * Implement Discord Service - Implement Discord Service - Add discordTimeout config variable - Add additional logger setup to mute unimportant messages introduced by serenity
Refactor codebase (#23) - Refined some derived traits - Refactor Service/ServiceInfo: Move some trait implementations from Service to ServiceInfo and refer to the implementations from Service - Compare ID instead of name in ServiceManagerBuilder
Add Service Framework (#21) * Implement service framework - Make main async - Implement Status enum - Implement Priority enum - Implement ServiceInfo struct - Implement ServiceInternals trait - Implement Service trait * Bot library - Add fern crate - Add humantime crate - Add log crate - Implement Bot - Implement BotBuilder - Refactor config Display trait implementation - Implement library is_debug() function - Implement library run(Bot) function - Implement log module (log::setup(), log::is_set_up() and log::get_min_log_level()) - Adapt main to new changes * WIP: Finish services framework Just a lot of refactoring and fixing. No time to describe all this now. Happy new year! :) * Finish services framework Too much to describe. It's done, that's it. This was one hell of a ride.
PreviousNext