Skip to content

Commit

Permalink
Renamed session model indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Mar 2, 2023
1 parent fd2a28e commit 1231691
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion context/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (c *Context) RemovePeerIfExists(key string) error {
return err
}
if !ok {
c.Log().Info("Peer does not exist", "key", key)
c.Log().Debug("Peer does not exist", "key", key)
return nil
}

Expand Down
2 changes: 2 additions & 0 deletions node/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ func (n *Node) jobSetSessions() error {
return err
}

n.Log().Debug("Validating the peers", "count", len(peers))

for i := 0; i < len(peers); i++ {
var item types.Session
n.Database().Model(
Expand Down
4 changes: 2 additions & 2 deletions types/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
type Session struct {
gorm.Model
ID uint64 `gorm:"primaryKey;uniqueIndex:idx_sessions_id"`
Subscription uint64 `gorm:"index:idx_sessions_subscription_for_address"`
Subscription uint64 `gorm:"index:idx_sessions_subscription_address"`
Key string `gorm:"uniqueIndex:idx_sessions_key"`
Address string `gorm:"index:idx_sessions_address;index:idx_sessions_subscription_for_address"`
Address string `gorm:"index:idx_sessions_address;index:idx_sessions_subscription_address"`
Available int64
Download int64
Upload int64
Expand Down

0 comments on commit 1231691

Please sign in to comment.