should backoff reasonably now
This commit is contained in:
@@ -2,9 +2,8 @@ package database
|
||||
|
||||
import (
|
||||
"git.eeqj.de/sneak/feta/instance"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
_ "github.com/jinzhu/gorm/dialects/sqlite"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
func (m *Manager) SaveInstance(i *instance.Instance) error {
|
||||
@@ -20,6 +19,7 @@ func (m *Manager) SaveInstance(i *instance.Instance) error {
|
||||
UUID: i.UUID,
|
||||
Disabled: i.Disabled,
|
||||
ErrorCount: i.ErrorCount,
|
||||
ConsecutiveErrorCount: i.ConsecutiveErrorCount,
|
||||
FSMState: i.Status(),
|
||||
Fetching: i.Fetching,
|
||||
HighestID: i.HighestID,
|
||||
@@ -46,6 +46,7 @@ func (m *Manager) SaveInstance(i *instance.Instance) error {
|
||||
m.db.Where("UUID = ?", i.UUID).First(&ei)
|
||||
ei.Disabled = i.Disabled
|
||||
ei.ErrorCount = i.ErrorCount
|
||||
ei.ConsecutiveErrorCount = i.ConsecutiveErrorCount
|
||||
ei.FSMState = i.Status()
|
||||
ei.Fetching = i.Fetching
|
||||
ei.HighestID = i.HighestID
|
||||
@@ -74,6 +75,7 @@ func (m *Manager) ListInstances() ([]*instance.Instance, error) {
|
||||
x.UUID = i.UUID
|
||||
x.Disabled = i.Disabled
|
||||
x.ErrorCount = i.ErrorCount
|
||||
x.ConsecutiveErrorCount = i.ConsecutiveErrorCount
|
||||
x.InitialFSMState = i.FSMState
|
||||
x.Fetching = i.Fetching
|
||||
x.HighestID = i.HighestID
|
||||
|
||||
@@ -27,6 +27,7 @@ type StoredToot struct {
|
||||
type APInstance struct {
|
||||
gorm.Model
|
||||
UUID uuid.UUID `gorm:"type:uuid;primary_key;"`
|
||||
ConsecutiveErrorCount uint
|
||||
ErrorCount uint
|
||||
SuccessCount uint
|
||||
HighestID uint
|
||||
|
||||
Reference in New Issue
Block a user