remove async_trait for TableRepair
Some checks failed
ci/woodpecker/pr/debug Pipeline failed
ci/woodpecker/push/debug Pipeline failed

This commit is contained in:
Alex 2025-02-05 20:39:43 +01:00
parent 5475da8ea8
commit 42e2ac4ec1

View file

@ -1,5 +1,6 @@
use std::sync::Arc;
use std::time::Duration;
use std::future::Future;
use async_trait::async_trait;
use tokio::sync::watch;
@ -93,17 +94,16 @@ pub async fn launch_online_repair(
// ----
#[async_trait]
trait TableRepair: Send + Sync + 'static {
type T: TableSchema;
fn table(garage: &Garage) -> &Table<Self::T, TableShardedReplication>;
async fn process(
fn process(
&mut self,
garage: &Garage,
entry: <<Self as TableRepair>::T as TableSchema>::E,
) -> Result<bool, Error>;
) -> impl Future<Output=Result<bool, Error>> + Send;
}
struct TableRepairWorker<T: TableRepair> {
@ -174,7 +174,6 @@ impl<R: TableRepair> Worker for TableRepairWorker<R> {
struct RepairVersions;
#[async_trait]
impl TableRepair for RepairVersions {
type T = VersionTable;
@ -221,7 +220,6 @@ impl TableRepair for RepairVersions {
struct RepairBlockRefs;
#[async_trait]
impl TableRepair for RepairBlockRefs {
type T = BlockRefTable;
@ -257,7 +255,6 @@ impl TableRepair for RepairBlockRefs {
struct RepairMpu;
#[async_trait]
impl TableRepair for RepairMpu {
type T = MultipartUploadTable;