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:
e-ngo 2025-07-03 05:46:21 -07:00 committed by GitHub
parent 1a132f534e
commit b66c49f3a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 6 deletions

View File

@ -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"
}

View File

@ -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) {