Tune dragonfly to Remove Old Entries & Use Longtext to fit larger warming jobs (#4145)
* Tune dragonfly to fit our usecase by: * use longtext to fit larger clusters * fix scheduler and seed-client register logic * Remove commented out lines.
This commit is contained in:
parent
1a132f534e
commit
b66c49f3a9
|
|
@ -88,7 +88,7 @@ func (m JSONMap) GormDataType() string {
|
|||
}
|
||||
|
||||
func (JSONMap) GormDBDataType(db *gorm.DB, field *schema.Field) string {
|
||||
return "text"
|
||||
return "longtext"
|
||||
}
|
||||
|
||||
type Array []string
|
||||
|
|
@ -137,5 +137,5 @@ func (Array) GormDataType() string {
|
|||
}
|
||||
|
||||
func (Array) GormDBDataType(db *gorm.DB, field *schema.Field) string {
|
||||
return "text"
|
||||
return "longtext"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -238,8 +238,6 @@ func (s *managerServerV2) UpdateSeedPeer(ctx context.Context, req *managerv2.Upd
|
|||
seedPeer := models.SeedPeer{}
|
||||
if err := s.db.WithContext(ctx).First(&seedPeer, models.SeedPeer{
|
||||
Hostname: req.Hostname,
|
||||
IP: req.Ip,
|
||||
Port: req.Port,
|
||||
SeedPeerClusterID: uint(req.SeedPeerClusterId),
|
||||
}).Error; err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
|
|
@ -452,8 +450,6 @@ func (s *managerServerV2) UpdateScheduler(ctx context.Context, req *managerv2.Up
|
|||
scheduler := models.Scheduler{}
|
||||
if err := s.db.WithContext(ctx).First(&scheduler, models.Scheduler{
|
||||
Hostname: req.Hostname,
|
||||
IP: req.Ip,
|
||||
Port: req.Port,
|
||||
SchedulerClusterID: uint(req.SchedulerClusterId),
|
||||
}).Error; err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue