Skip to content

Commit

Permalink
feat(task): add trace log of enqueued tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed Jan 10, 2025
1 parent 02f2772 commit cfd385c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Added `trace` log of enqueued tasks. [himalaya#518]

## [0.2.2] - 2024-12-09

Starting from this release, we maintain the git history and the changelogs as clean as possible. The documentation will come in the nearest releases.

[0.2.2]: https://github.com/pimalaya/imap-client/releases/tag/v0.2.2

[himalaya#518]: https://github.com/pimalaya/himalaya/issues/518
7 changes: 5 additions & 2 deletions src/tasks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use imap_next::{
Interrupt, State,
};
use thiserror::Error;
use tracing::trace;

/// Tells how a specific IMAP [`Command`] is processed.
///
Expand Down Expand Up @@ -110,15 +111,17 @@ impl Scheduler {
{
let tag = self.tag_generator.generate();

let cmd = {
let command = {
let body = task.command_body();
Command {
tag: tag.clone(),
body,
}
};

let handle = self.client_next.enqueue_command(cmd);
trace!(?command, "enqueue task");

let handle = self.client_next.enqueue_command(command);

self.waiting_tasks.push_back(handle, tag, Box::new(task));

Expand Down

0 comments on commit cfd385c

Please sign in to comment.