mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
Feat/implement rest of poly effects (#2587)
* feat: Add the implementation of the rest of the polyfillEffects * chore: Add in the rsync * chore: Add in the changes needed to indicate that the service does not need config * fix: Vaultwarden sets, starts, stops, uninstalls * chore: Update the polyFilleffect and add two more * Update MainLoop.ts * chore: Add in the set config of the deps on the config set
This commit is contained in:
@@ -3,7 +3,7 @@ use std::time::Duration;
|
||||
use models::ProcedureName;
|
||||
|
||||
use crate::config::action::ConfigRes;
|
||||
use crate::config::ConfigureContext;
|
||||
use crate::config::{action::SetResult, ConfigureContext};
|
||||
use crate::prelude::*;
|
||||
use crate::service::{Service, ServiceActor};
|
||||
use crate::util::actor::{BackgroundJobs, Handler};
|
||||
@@ -18,10 +18,25 @@ impl Handler<Configure> for ServiceActor {
|
||||
_: &mut BackgroundJobs,
|
||||
) -> Self::Response {
|
||||
let container = &self.0.persistent_container;
|
||||
let package_id = &self.0.id;
|
||||
|
||||
container
|
||||
.execute::<NoOutput>(ProcedureName::SetConfig, to_value(&config)?, timeout)
|
||||
.await
|
||||
.with_kind(ErrorKind::ConfigRulesViolation)?;
|
||||
self.0
|
||||
.ctx
|
||||
.db
|
||||
.mutate(move |db| {
|
||||
db.as_public_mut()
|
||||
.as_package_data_mut()
|
||||
.as_idx_mut(package_id)
|
||||
.or_not_found(package_id)?
|
||||
.as_status_mut()
|
||||
.as_configured_mut()
|
||||
.ser(&true)
|
||||
})
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -38,7 +53,7 @@ impl Handler<GetConfig> for ServiceActor {
|
||||
Some(Duration::from_secs(30)), // TODO timeout
|
||||
)
|
||||
.await
|
||||
.with_kind(ErrorKind::ConfigGen)
|
||||
.with_kind(ErrorKind::ConfigRulesViolation)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -281,6 +281,9 @@ impl Service {
|
||||
.as_package_data_mut()
|
||||
.as_idx_mut(&manifest.id)
|
||||
.or_not_found(&manifest.id)?;
|
||||
if !manifest.has_config {
|
||||
entry.as_status_mut().as_configured_mut().ser(&true)?;
|
||||
}
|
||||
entry
|
||||
.as_state_info_mut()
|
||||
.ser(&PackageState::Installed(InstalledState { manifest }))?;
|
||||
|
||||
Reference in New Issue
Block a user