Store failed requests in db for later retries
This commit is contained in:
parent
d86ad370df
commit
1c216e415d
8 changed files with 1292 additions and 250 deletions
18
storage-new/models/FailedOutboundRequests.go
Normal file
18
storage-new/models/FailedOutboundRequests.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// Stores an outbound request that hasn't successfully resolved yet
|
||||
type FailedOutboundRequest struct {
|
||||
Id uint64 `gorm:"primarykey"`
|
||||
RawData []byte // The body data of the request
|
||||
Target string // The url to send the data to (via post)
|
||||
FirstAttempt time.Time // When the first attempt was started
|
||||
LastAttempt time.Time // When the latest attempt was started
|
||||
ActingUser *User // The user on who's behalf the request is being performed
|
||||
ActingUserId string // Id of the acting user
|
||||
NrOfAttempts uint32 // How often the request was attempted already
|
||||
LastFailureReason string // The reason why the last attempt failed (actually a FailedOutboundRequestReason)
|
||||
TargetServer *RemoteServer // The remote server being targeted. Included to determine if a request still has a chance of success
|
||||
TargetServerId uint // Id of the target remote server
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue