Skip to content

Commit

Permalink
feat: activity:started event (#475)
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
  • Loading branch information
bajtos authored Feb 5, 2024
1 parent 75e088f commit 800fd1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions daemon/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use zinnia_runtime::{
get_module_root, lassie, lassie_config, resolve_path, run_js_module, BootstrapOptions,
};

use crate::station_reporter::{log_info_activity, StationReporter};
use crate::station_reporter::{log_started_activity, StationReporter};

#[tokio::main(flavor = "current_thread")]
async fn main() {
Expand Down Expand Up @@ -56,7 +56,7 @@ async fn run(config: CliArgs) -> Result<RunOutput> {
.context("cannot initialize the IPFS retrieval client Lassie")?,
);

log_info_activity("Zinnia started");
log_started_activity();

let file = &config.files[0];

Expand Down
9 changes: 9 additions & 0 deletions daemon/station_reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ fn print_event(data: &serde_json::Value) {
});
}

pub fn log_started_activity() {
let event = json!({
"type": "activity:started",
"module": serde_json::Value::Null,
});
print_event(&event);
}

#[allow(unused)]
pub fn log_info_activity(msg: &str) {
let event = json!({
"type": "activity:info",
Expand Down

0 comments on commit 800fd1a

Please sign in to comment.