Work on failed outbound requests and move type migrators
- DB type migrators are now in separate file, in preparation for full custom sql migration statements - Start work on handling failed outbound requests stored in the db
This commit is contained in:
parent
81a01fbf8b
commit
7ac4c628b8
13 changed files with 372 additions and 145 deletions
|
@ -16,3 +16,17 @@ type FailedOutboundRequest struct {
|
|||
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
|
||||
}
|
||||
|
||||
type IFailedOutboundRequest interface {
|
||||
// KillServers marks all servers where a request has more than X failed attempts as dead
|
||||
//
|
||||
// WITH servers_to_kill AS (
|
||||
// SELECT target_server_id
|
||||
// FROM failed_outbound_requests
|
||||
// WHERE nr_of_attempts > @maxAttempts
|
||||
// )
|
||||
// UPDATE remote_servers
|
||||
// SET is_dead = true
|
||||
// WHERE id IN (SELECT target_server_id FROM servers_to_kill)
|
||||
KillServers(maxAttempts uint32) error
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ type ServerMetadata struct {
|
|||
UpdatedAt time.Time
|
||||
|
||||
// ---- Section TLS LetsEncrypt
|
||||
|
||||
LEDomain string
|
||||
LECertUrl string
|
||||
LECertStableUrl string
|
||||
|
@ -21,4 +22,7 @@ type ServerMetadata struct {
|
|||
LECSR []byte // Encrypted
|
||||
LELastUpdate sql.NullTime
|
||||
LEUserPrivKey []byte // Encrypted
|
||||
|
||||
// ---- Section Database
|
||||
LastMigrationVersion uint64
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue