mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-08-29 05:52:08 -04:00
feat: README, config.example, turnstile integration, exchange rate, auth utils refactor
This commit is contained in:
@@ -4,7 +4,7 @@ use asynq::error::Result;
|
||||
use asynq::task::Task;
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::queue::service::task::QuotaTaskLogic;
|
||||
use crate::queue::service::task::{QuotaTaskLogic, RateLogic};
|
||||
use crate::repository::Repositories;
|
||||
|
||||
pub async fn quota_task(task: Task, repos: Arc<Repositories>, config: Arc<Config>) -> Result<()> {
|
||||
@@ -13,3 +13,12 @@ pub async fn quota_task(task: Task, repos: Arc<Repositories>, config: Arc<Config
|
||||
.await
|
||||
.map_err(|e| asynq::error::Error::other(e.to_string()))
|
||||
}
|
||||
|
||||
/// Fetch the current exchange rate and persist it.
|
||||
/// Scheduled daily at 01:00 by the scheduler (mirrors `rateLogic.go`).
|
||||
pub async fn rate_task(_task: Task, repos: Arc<Repositories>, config: Arc<Config>) -> Result<()> {
|
||||
RateLogic::new(repos, config)
|
||||
.execute()
|
||||
.await
|
||||
.map_err(|e| asynq::error::Error::other(e.to_string()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user