feature: Trace log message on ExecRequest for debugging (#375)
This commit is contained in:
parent
6958445f83
commit
8cd5b9fb46
|
|
@ -135,11 +135,6 @@ func (e *Executor) AddListener(m listener) {
|
|||
// ExecRequest processes an ExecutionRequest
|
||||
func (e *Executor) ExecRequest(req *ExecutionRequest) (*sync.WaitGroup, string) {
|
||||
req.executor = e
|
||||
|
||||
// req.UUID is now set by the client, so that they can track the request
|
||||
// from start to finish. This means that a malicious client could send
|
||||
// duplicate UUIDs (or just random strings), but this is the only way.
|
||||
|
||||
req.logEntry = &InternalLogEntry{
|
||||
DatetimeStarted: time.Now(),
|
||||
ExecutionTrackingID: req.TrackingID,
|
||||
|
|
@ -152,12 +147,14 @@ func (e *Executor) ExecRequest(req *ExecutionRequest) (*sync.WaitGroup, string)
|
|||
ActionIcon: "💩",
|
||||
}
|
||||
|
||||
_, foundLog := e.Logs[req.TrackingID]
|
||||
_, isDuplicate := e.Logs[req.TrackingID]
|
||||
|
||||
if foundLog || req.TrackingID == "" {
|
||||
if isDuplicate || req.TrackingID == "" {
|
||||
req.TrackingID = uuid.NewString()
|
||||
}
|
||||
|
||||
log.Tracef("executor.ExecRequest(): %v", req)
|
||||
|
||||
e.Logs[req.TrackingID] = req.logEntry
|
||||
|
||||
wg := new(sync.WaitGroup)
|
||||
|
|
|
|||
Loading…
Reference in New Issue