-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from BloodHoundAD/BED-3285
Add backoff retry logic for ingest + send proper v2 messages
- Loading branch information
Showing
2 changed files
with
110 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package models | ||
|
||
type CompleteJobRequest struct { | ||
Status string `json:"status"` | ||
StatusEnum JobStatus `json:"-"` | ||
Message string `json:"message"` | ||
} | ||
|
||
type JobStatus int | ||
|
||
const ( | ||
JobStatusInvalid JobStatus = -1 | ||
JobStatusReady JobStatus = 0 | ||
JobStatusRunning JobStatus = 1 | ||
JobStatusComplete JobStatus = 2 | ||
JobStatusCanceled JobStatus = 3 | ||
JobStatusTimedOut JobStatus = 4 | ||
JobStatusFailed JobStatus = 5 | ||
JobStatusIngesting JobStatus = 6 | ||
) | ||
|
||
func (s JobStatus) String() string { | ||
switch s { | ||
case JobStatusReady: | ||
return "READY" | ||
|
||
case JobStatusRunning: | ||
return "RUNNING" | ||
|
||
case JobStatusComplete: | ||
return "COMPLETE" | ||
|
||
case JobStatusCanceled: | ||
return "CANCELED" | ||
|
||
case JobStatusTimedOut: | ||
return "TIMEDOUT" | ||
|
||
case JobStatusFailed: | ||
return "FAILED" | ||
|
||
case JobStatusIngesting: | ||
return "INGESTING" | ||
|
||
default: | ||
return "INVALIDSTATUS" | ||
} | ||
} |