removed swapping of the db
This commit is contained in:
Submodule client-gui2 updated: 5c3181a65d...412a577e47
@@ -12,7 +12,6 @@ service BackupService {
|
|||||||
rpc ListDatabases(komp_ac.common.Empty) returns (ListDatabasesResponse);
|
rpc ListDatabases(komp_ac.common.Empty) returns (ListDatabasesResponse);
|
||||||
rpc CreateDatabase(CreateDatabaseRequest) returns (DatabaseInfo);
|
rpc CreateDatabase(CreateDatabaseRequest) returns (DatabaseInfo);
|
||||||
rpc RunDatabaseMigrations(DatabaseRequest) returns (DatabaseInfo);
|
rpc RunDatabaseMigrations(DatabaseRequest) returns (DatabaseInfo);
|
||||||
rpc ActivateDatabase(DatabaseRequest) returns (ActivateDatabaseResponse);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message DatabaseRequest {
|
message DatabaseRequest {
|
||||||
@@ -40,12 +39,6 @@ message ListDatabasesResponse {
|
|||||||
repeated DatabaseInfo databases = 2;
|
repeated DatabaseInfo databases = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ActivateDatabaseResponse {
|
|
||||||
string database_name = 1;
|
|
||||||
bool switching = 2;
|
|
||||||
string message = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum BackupType {
|
enum BackupType {
|
||||||
BACKUP_TYPE_UNSPECIFIED = 0;
|
BACKUP_TYPE_UNSPECIFIED = 0;
|
||||||
BACKUP_TYPE_FULL = 1;
|
BACKUP_TYPE_FULL = 1;
|
||||||
|
|||||||
Binary file not shown.
@@ -37,15 +37,6 @@ pub struct ListDatabasesResponse {
|
|||||||
#[prost(message, repeated, tag = "2")]
|
#[prost(message, repeated, tag = "2")]
|
||||||
pub databases: ::prost::alloc::vec::Vec<DatabaseInfo>,
|
pub databases: ::prost::alloc::vec::Vec<DatabaseInfo>,
|
||||||
}
|
}
|
||||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
|
||||||
pub struct ActivateDatabaseResponse {
|
|
||||||
#[prost(string, tag = "1")]
|
|
||||||
pub database_name: ::prost::alloc::string::String,
|
|
||||||
#[prost(bool, tag = "2")]
|
|
||||||
pub switching: bool,
|
|
||||||
#[prost(string, tag = "3")]
|
|
||||||
pub message: ::prost::alloc::string::String,
|
|
||||||
}
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
||||||
pub struct StartBackupRequest {
|
pub struct StartBackupRequest {
|
||||||
#[prost(enumeration = "BackupType", tag = "1")]
|
#[prost(enumeration = "BackupType", tag = "1")]
|
||||||
@@ -484,32 +475,6 @@ pub mod backup_service_client {
|
|||||||
);
|
);
|
||||||
self.inner.unary(req, path, codec).await
|
self.inner.unary(req, path, codec).await
|
||||||
}
|
}
|
||||||
pub async fn activate_database(
|
|
||||||
&mut self,
|
|
||||||
request: impl tonic::IntoRequest<super::DatabaseRequest>,
|
|
||||||
) -> std::result::Result<
|
|
||||||
tonic::Response<super::ActivateDatabaseResponse>,
|
|
||||||
tonic::Status,
|
|
||||||
> {
|
|
||||||
self.inner
|
|
||||||
.ready()
|
|
||||||
.await
|
|
||||||
.map_err(|e| {
|
|
||||||
tonic::Status::unknown(
|
|
||||||
format!("Service was not ready: {}", e.into()),
|
|
||||||
)
|
|
||||||
})?;
|
|
||||||
let codec = tonic_prost::ProstCodec::default();
|
|
||||||
let path = http::uri::PathAndQuery::from_static(
|
|
||||||
"/komp_ac.backup.BackupService/ActivateDatabase",
|
|
||||||
);
|
|
||||||
let mut req = request.into_request();
|
|
||||||
req.extensions_mut()
|
|
||||||
.insert(
|
|
||||||
GrpcMethod::new("komp_ac.backup.BackupService", "ActivateDatabase"),
|
|
||||||
);
|
|
||||||
self.inner.unary(req, path, codec).await
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Generated server implementations.
|
/// Generated server implementations.
|
||||||
@@ -575,13 +540,6 @@ pub mod backup_service_server {
|
|||||||
&self,
|
&self,
|
||||||
request: tonic::Request<super::DatabaseRequest>,
|
request: tonic::Request<super::DatabaseRequest>,
|
||||||
) -> std::result::Result<tonic::Response<super::DatabaseInfo>, tonic::Status>;
|
) -> std::result::Result<tonic::Response<super::DatabaseInfo>, tonic::Status>;
|
||||||
async fn activate_database(
|
|
||||||
&self,
|
|
||||||
request: tonic::Request<super::DatabaseRequest>,
|
|
||||||
) -> std::result::Result<
|
|
||||||
tonic::Response<super::ActivateDatabaseResponse>,
|
|
||||||
tonic::Status,
|
|
||||||
>;
|
|
||||||
}
|
}
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct BackupServiceServer<T> {
|
pub struct BackupServiceServer<T> {
|
||||||
@@ -1024,52 +982,6 @@ pub mod backup_service_server {
|
|||||||
};
|
};
|
||||||
Box::pin(fut)
|
Box::pin(fut)
|
||||||
}
|
}
|
||||||
"/komp_ac.backup.BackupService/ActivateDatabase" => {
|
|
||||||
#[allow(non_camel_case_types)]
|
|
||||||
struct ActivateDatabaseSvc<T: BackupService>(pub Arc<T>);
|
|
||||||
impl<
|
|
||||||
T: BackupService,
|
|
||||||
> tonic::server::UnaryService<super::DatabaseRequest>
|
|
||||||
for ActivateDatabaseSvc<T> {
|
|
||||||
type Response = super::ActivateDatabaseResponse;
|
|
||||||
type Future = BoxFuture<
|
|
||||||
tonic::Response<Self::Response>,
|
|
||||||
tonic::Status,
|
|
||||||
>;
|
|
||||||
fn call(
|
|
||||||
&mut self,
|
|
||||||
request: tonic::Request<super::DatabaseRequest>,
|
|
||||||
) -> Self::Future {
|
|
||||||
let inner = Arc::clone(&self.0);
|
|
||||||
let fut = async move {
|
|
||||||
<T as BackupService>::activate_database(&inner, request)
|
|
||||||
.await
|
|
||||||
};
|
|
||||||
Box::pin(fut)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let accept_compression_encodings = self.accept_compression_encodings;
|
|
||||||
let send_compression_encodings = self.send_compression_encodings;
|
|
||||||
let max_decoding_message_size = self.max_decoding_message_size;
|
|
||||||
let max_encoding_message_size = self.max_encoding_message_size;
|
|
||||||
let inner = self.inner.clone();
|
|
||||||
let fut = async move {
|
|
||||||
let method = ActivateDatabaseSvc(inner);
|
|
||||||
let codec = tonic_prost::ProstCodec::default();
|
|
||||||
let mut grpc = tonic::server::Grpc::new(codec)
|
|
||||||
.apply_compression_config(
|
|
||||||
accept_compression_encodings,
|
|
||||||
send_compression_encodings,
|
|
||||||
)
|
|
||||||
.apply_max_message_size_config(
|
|
||||||
max_decoding_message_size,
|
|
||||||
max_encoding_message_size,
|
|
||||||
);
|
|
||||||
let res = grpc.unary(method, req).await;
|
|
||||||
Ok(res)
|
|
||||||
};
|
|
||||||
Box::pin(fut)
|
|
||||||
}
|
|
||||||
_ => {
|
_ => {
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
let mut response = http::Response::new(
|
let mut response = http::Response::new(
|
||||||
|
|||||||
2
server
2
server
Submodule server updated: ec9f1f19de...8f18fa39e3
Reference in New Issue
Block a user