Properly update repo consistency metadata
Previously these two queries did nothing at all -_- Note that this will trigger a full re-index of every repo seen on the firehose.main
parent
080cbb8b12
commit
57aa4731e5
|
@ -358,7 +358,7 @@ func (c *Consumer) processMessage(ctx context.Context, typ string, r io.Reader,
|
||||||
|
|
||||||
if payload.TooBig {
|
if payload.TooBig {
|
||||||
// Just trigger a re-index by resetting rev.
|
// Just trigger a re-index by resetting rev.
|
||||||
err := c.db.Model(r).Where(&repo.Repo{ID: repoInfo.ID}).
|
err := c.db.Model(&repo.Repo{}).Where(&repo.Repo{ID: repoInfo.ID}).
|
||||||
Updates(&repo.Repo{
|
Updates(&repo.Repo{
|
||||||
FirstCursorSinceReset: c.remote.FirstCursorSinceReset,
|
FirstCursorSinceReset: c.remote.FirstCursorSinceReset,
|
||||||
FirstRevSinceReset: payload.Rev,
|
FirstRevSinceReset: payload.Rev,
|
||||||
|
@ -369,7 +369,7 @@ func (c *Consumer) processMessage(ctx context.Context, typ string, r io.Reader,
|
||||||
}
|
}
|
||||||
|
|
||||||
if repoInfo.FirstCursorSinceReset != c.remote.FirstCursorSinceReset {
|
if repoInfo.FirstCursorSinceReset != c.remote.FirstCursorSinceReset {
|
||||||
err := c.db.Model(r).Where(&repo.Repo{ID: repoInfo.ID}).
|
err := c.db.Model(&repo.Repo{}).Debug().Where(&repo.Repo{ID: repoInfo.ID}).
|
||||||
Updates(&repo.Repo{
|
Updates(&repo.Repo{
|
||||||
FirstCursorSinceReset: c.remote.FirstCursorSinceReset,
|
FirstCursorSinceReset: c.remote.FirstCursorSinceReset,
|
||||||
FirstRevSinceReset: payload.Rev,
|
FirstRevSinceReset: payload.Rev,
|
||||||
|
|
Loading…
Reference in New Issue