Skip to content

Commit

Permalink
plugin-v2024090101
Browse files Browse the repository at this point in the history
  • Loading branch information
MXWXZ committed Sep 2, 2024
1 parent 1306e34 commit 6df69e1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
27 changes: 17 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# plugin-2024083102
# plugin-v2024090101
## Components
- monitor: 0.2.3 => 0.2.4

## Bug fix
1. Fix passive agent connect bug.

# plugin-v2024083102
## Components
- monitor: 0.2.2 => 0.2.3

## Bug fix
1. Fix postgres backend bug.

# 0.2.2
# v0.2.2
## Bug fix
1. Fix postgres backend bug.

# plugin-2024083101
# plugin-v2024083101
## Components
- agent: 0.2.1 => 0.3.0
- skynet_api_agent: 0.2.1 => 0.3.0
Expand All @@ -19,15 +26,15 @@
1. `agent`: Support `restart` option.
2. `monitor`, `skynet_api_agent`: Version check will depend on `agent` version instead of `skynet_api_agent` version.

# 0.2.1
# v0.2.1
## Bug fix
1. Fix `no process-level CryptoProvider` for rustls 0.23.

# plugin-0.2.1
# plugin-v0.2.1
## Bug fix
1. Fix `no process-level CryptoProvider` for rustls 0.23.

# 0.2.0
# v0.2.0
## Breaking changes
1. `skynet` crate is split to `skynet` and `skynet_api`, plugins now should depend on `skynet_api`.
2. Based on new framework `actix-cloud`.
Expand All @@ -41,20 +48,20 @@
## Bug fix
1. Fix a bug that prevent success logs written to the database.

# plugin-0.2.0
# plugin-v0.2.0
## Breaking changes
1. Compatible to the new `skynet_api` design.
2. Redesign C/S framework.

## New features
1. Support passive agents.

# plugin-0.1.1
# plugin-v0.1.1
## Bug fix
1. Fix segmentation fault when loading plugins.
2. Fix monitor database foreign key error.

# 0.1.1
# v0.1.1
## Changes
1. `listen.ssl` will only raise warning when `proxy.enable` is `false`.

Expand All @@ -66,5 +73,5 @@
5. Fix plugin segmentation fault in some systems.
6. Fix segmentation fault when shared API is enabled.

# 0.1.0
# v0.1.0
First version of skynet!
1 change: 1 addition & 0 deletions plugin/monitor/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ pub async fn add_passive_agents(param: Json<AddPassiveAgentsReq>) -> RspResult<i
.create_passive(&tx, &param.name, &param.address, param.retry_time)
.await?;
tx.commit().await?;
srv.server.connect(&m.id);

info!(
success = true,
Expand Down
10 changes: 6 additions & 4 deletions plugin/monitor/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,25 @@ impl Service {
Ok(())
}

/// Create passive agents.
///
/// This method will NOT add agent to server, please invoke `connect` AFTER commit `db`.
pub async fn create_passive(
&self,
db: &DatabaseTransaction,
name: &str,
address: &str,
retry_time: i32,
) -> Result<passive_agents::Model> {
let ret = passive_agents::ActiveModel {
passive_agents::ActiveModel {
name: Set(name.to_owned()),
address: Set(address.to_owned()),
retry_time: Set(retry_time),
..Default::default()
}
.insert(db)
.await?;
self.server.connect(&ret.id);
Ok(ret)
.await
.map_err(Into::into)
}

pub async fn delete_passive(&self, db: &DatabaseTransaction, paid: &[HyUuid]) -> Result<u64> {
Expand Down

0 comments on commit 6df69e1

Please sign in to comment.