Skip to content

Add explicit stop method to Auditable #5413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

stevejgordon
Copy link
Contributor

Resolves #5363

Allows consumers of Auditable to explicitly call Stop to set the ended DateTime on the Audit object. This ensures that by the time this is available in a DiagnosticsListener Audit has a valid end DateTime set. Otherwise, it is the default until the Auditable is disposed.

@@ -43,9 +42,11 @@ public string Path
set => _audit.Path = value;
}

public void Stop() => _audit.Ended = _dateTimeProvider.Now();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, do we want this to be called multiple times to override or not?

I think its fine as is.

@stevejgordon stevejgordon merged commit 9cc8548 into 7.12 Mar 22, 2021
@stevejgordon stevejgordon deleted the bug/audit-ended-with-diagnostics branch March 22, 2021 13:52
github-actions bot pushed a commit that referenced this pull request Mar 22, 2021
@github-actions
Copy link
Contributor

The backport to master failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-master master
# Navigate to the new working tree
cd .worktrees/backport-master
# Create a new branch
git switch --create backport-5413-to-master
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick ---mainline 1 9cc8548439d3a9a0e4c3f54f128e99287002c143
# Push it to GitHub
git push --set-upstream origin backport-5413-to-master
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-master

Then, create a pull request where the base branch is master and the compare/head branch is backport-5413-to-master.

stevejgordon added a commit that referenced this pull request Mar 23, 2021
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants