Skip to content

Commit 8ff47e0

Browse files
authored
chore(repo): add debug logging to running tasks service (#31224)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> There are very few logs for the running task service. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> There are logs for the running task service. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
1 parent d3ecffe commit 8ff47e0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/nx/src/native/tasks/running_tasks_service.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ impl RunningTasksService {
3232
let mut results = Vec::<String>::with_capacity(ids.len());
3333
for id in ids.into_iter() {
3434
if self.is_task_running(&id)? {
35+
debug!("Task {} is running", &id);
3536
results.push(id);
37+
} else {
38+
debug!("Task {} is not running", id);
3639
}
3740
}
3841
Ok(results)
@@ -99,6 +102,7 @@ impl RunningTasksService {
99102
"INSERT OR REPLACE INTO running_tasks (task_id, pid, command, cwd) VALUES (?, ?, ?, ?)",
100103
)?;
101104
stmt.execute([&task_id, &pid.to_string(), &command_str, &cwd])?;
105+
debug!("Added {} to running tasks", &task_id);
102106
self.added_tasks.insert(task_id);
103107
Ok(())
104108
}
@@ -108,7 +112,8 @@ impl RunningTasksService {
108112
let mut stmt = self
109113
.db
110114
.prepare("DELETE FROM running_tasks WHERE task_id = ?")?;
111-
stmt.execute([task_id])?;
115+
stmt.execute([&task_id])?;
116+
debug!("Removed {} from running tasks", task_id);
112117
Ok(())
113118
}
114119

@@ -123,6 +128,7 @@ impl RunningTasksService {
123128
);
124129
",
125130
)?;
131+
debug!("Setup running tasks service");
126132
Ok(())
127133
}
128134
}

0 commit comments

Comments
 (0)