-
Notifications
You must be signed in to change notification settings - Fork 618
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
Windows service #1070
Windows service #1070
Changes from 1 commit
2954177
6eadfe7
c3d7f6c
d3d57cd
2f7dc6d
b87ab7e
4aea88d
903ec56
9ce866b
d8c4796
d83b49a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- v1.89.3
- v1.89.2
- v1.89.1
- v1.88.0
- v1.87.1
- v1.87.0
- v1.86.3
- v1.86.2
- v1.86.1
- v1.86.0
- v1.85.2
- v1.85.1
- v1.85.0
- v1.84.0
- v1.83.0
- v1.82.4
- v1.82.3
- v1.82.2
- v1.82.1
- v1.82.0
- v1.81.1
- v1.81.0
- v1.80.0
- v1.79.2
- v1.79.1
- v1.79.0
- v1.78.1
- v1.78.0
- v1.77.0
- v1.76.0
- v1.75.3
- v1.75.0
- v1.74.1
- v1.73.1
- v1.73.0
- v1.72.0
- v1.71.2
- v1.71.1
- v1.71.0
- v1.70.2
- v1.70.1
- v1.70.0
- v1.69.0
- v1.68.2
- v1.68.0
- v1.67.2
- v1.67.1
- v1.67.0
- v1.66.2
- v1.66.1
- v1.66.0
- v1.65.1
- v1.65.0
- v1.64.0
- v1.63.1
- v1.63.0
- v1.62.2
- v1.62.1
- v1.62.0
- v1.61.3
- v1.61.2
- v1.61.1
- v1.61.0
- v1.60.1
- v1.60.0
- v1.59.0
- v1.58.0
- v1.57.1
- v1.57.0
- v1.56.0
- v1.55.5
- v1.55.4
- v1.55.3
- v1.55.2
- v1.55.1
- v1.55.0
- v1.54.1
- v1.54.0
- v1.53.1
- v1.53.0
- v1.52.2
- v1.52.1
- v1.52.0
- v1.51.0
- v1.50.3
- v1.50.2
- v1.50.1
- v1.50.0
- v1.49.0
- v1.48.1
- v1.48.0
- v1.47.0
- v1.46.0
- v1.45.0
- v1.44.4
- v1.44.3
- v1.44.2
- v1.44.1
- v1.44.0
- v1.43.0
- v1.42.0
- v1.41.1
- v1.41.0
- v1.40.0
- v1.39.0
- v1.38.0
- v1.37.0
- v1.36.2
- v1.36.1
- v1.36.0
- v1.35.0
- v1.34.0
- v1.33.0
- v1.32.1
- v1.32.0
- v1.31.0
- v1.30.0
- v1.29.1
- v1.29.0
- v1.28.1
- v1.28.0
- v1.27.0
- v1.26.1
- v1.26.0
- v1.25.3
- v1.25.2
- v1.25.1
- v1.25.0
- v1.24.0
- v1.23.0
- v1.22.0
- v1.21.0
- v1.20.3
- v1.20.2
- v1.20.1
- v1.20.0
- v1.19.1
- v1.19.0
- v1.18.0
- v1.17.3
- v1.17.2
- v1.17.1
- v1.17.0
- v1.16.2
- v1.16.1
- v1.16.0
- 1.85.3
- 1.68.1
- 1.44.4
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,14 +175,8 @@ func (h *handler) runAgent(ctx context.Context) { | |
|
||
// sleepCtx provides a cancelable sleep | ||
func sleepCtx(ctx context.Context, duration time.Duration) { | ||
done := make(chan struct{}) | ||
time.AfterFunc(duration, func() { | ||
close(done) | ||
}) | ||
select { | ||
case <-ctx.Done(): | ||
case <-done: | ||
} | ||
derivedCtx, _ := context.WithDeadline(ctx, time.Now().Add(duration)) | ||
<-derivedCtx.Done() | ||
} | ||
|
||
type termHandlerIndicator struct { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the way this indicator struct is being used. Out of curiosity -- is this implementing anything? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not that I'm aware of, but I didn't do a very deep search yet. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can instead use the stdlib (or golang.org/x/net)
context.WithDeadline
function and wait onctx.Done()
of that context.