Skip to content

Commit a8d2969

Browse files
authored
Merge pull request #34 from CoLearn-Dev/0.1.16
PO install & upgrade; storage prefix without value; bugfix - storage: maintain prefix in list_keys - storage: privilege check - pom: option for upgrade operator - pom: support install_script - mq: change account for amqp connection
2 parents ee63ec5 + ec8e89a commit a8d2969

File tree

11 files changed

+390
-163
lines changed

11 files changed

+390
-163
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "proto"]
22
path = proto
3-
url = git@github.com:CoLearn-Dev/colink-proto-dev.git
3+
url = https://github.com/CoLearn-Dev/colink-proto-dev.git
44
branch = main

Cargo.lock

Lines changed: 60 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
[package]
22
name = "colink-server"
3-
version = "0.1.15"
3+
version = "0.1.16"
44
edition = "2021"
55

66
[dependencies]
77
async-trait = "0.1"
88
chrono = "0.4"
99
flate2 = "1.0"
10+
fs4 = { version = "0.6", features = ["sync"] }
1011
futures-lite = "1.12"
1112
hex = "0.4"
1213
jsonwebtoken = "7.2"

proto

Submodule proto updated 1 file

src/mq/rabbitmq.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,7 @@ impl crate::mq::common::MQ for RabbitMQ {
239239

240240
impl RabbitMQ {
241241
async fn connect(&self, user_uri: &str) -> Result<Channel, String> {
242-
let user_uri = match url::Url::parse(user_uri) {
243-
Ok(uri) => uri,
244-
Err(e) => return Err(format!("MQ URI Parse Error: {}", e)),
245-
};
246-
let vhost_path = user_uri.path();
247-
let uri = self.mq_amqp.clone() + vhost_path;
248-
let mq = match Connection::connect(&uri, ConnectionProperties::default()).await {
242+
let mq = match Connection::connect(user_uri, ConnectionProperties::default()).await {
249243
Ok(mq) => mq,
250244
Err(e) => return Err(format!("MQ Connection Error: {}", e)),
251245
};

src/server.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ pub struct MyService {
2222
pub mq: Box<dyn MQ>,
2323
// We use this mutex to avoid the TOCTOU race condition in task storage.
2424
pub task_storage_mutex: Mutex<i32>,
25-
pub pom_fetch_mutex: Mutex<i32>,
2625
pub public_key: secp256k1::PublicKey,
2726
pub secret_key: secp256k1::SecretKey,
2827
pub inter_core_ca_certificate: Option<Certificate>,
@@ -126,14 +125,14 @@ impl CoLink for GrpcService {
126125

127126
async fn start_protocol_operator(
128127
&self,
129-
request: Request<ProtocolOperatorInstance>,
130-
) -> Result<Response<ProtocolOperatorInstance>, Status> {
128+
request: Request<StartProtocolOperatorRequest>,
129+
) -> Result<Response<ProtocolOperatorInstanceId>, Status> {
131130
self.service._start_protocol_operator(request).await
132131
}
133132

134133
async fn stop_protocol_operator(
135134
&self,
136-
request: Request<ProtocolOperatorInstance>,
135+
request: Request<ProtocolOperatorInstanceId>,
137136
) -> Result<Response<Empty>, Status> {
138137
self.service._stop_protocol_operator(request).await
139138
}
@@ -231,7 +230,6 @@ async fn run_server(
231230
jwt_secret,
232231
mq: Box::new(RabbitMQ::new(&mq_amqp, &mq_api, &mq_prefix)),
233232
task_storage_mutex: Mutex::new(0),
234-
pom_fetch_mutex: Mutex::new(0),
235233
secret_key: core_secret_key,
236234
public_key: core_public_key,
237235
inter_core_ca_certificate: None,

0 commit comments

Comments
 (0)