feat: update

This commit is contained in:
Rogee
2024-09-04 11:46:58 +08:00
parent 676b31bed3
commit a035a63f52
8 changed files with 154 additions and 12 deletions

View File

@@ -92,7 +92,13 @@ func (c *DBChannel) Get(ctx context.Context) error {
}
func (c *DBChannel) Update(ctx context.Context, offsetID int) error {
c.Offset = offsetID
if c.Offset == 0 {
c.Offset = offsetID
}
if c.Offset > offsetID {
c.Offset = offsetID
}
if c.MinID < offsetID {
c.MinID = offsetID