Skip to content

Commit

Permalink
internal/gaby: remove rules poster event watcher bootstrap
Browse files Browse the repository at this point in the history
Change-Id: I86f62045f3e3396cf72c6277420573acef978593
Reviewed-on: https://go-review.googlesource.com/c/oscar/+/638437
Reviewed-by: Keith Randall <[email protected]>
Reviewed-by: Jonathan Amsterdam <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
  • Loading branch information
randall77 committed Jan 2, 2025
1 parent f3d1282 commit 7a94449
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions internal/gaby/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import (
"golang.org/x/oscar/internal/secret"
"golang.org/x/oscar/internal/storage"
"golang.org/x/oscar/internal/storage/timed"
"rsc.io/ordered"
)

type gabyFlags struct {
Expand Down Expand Up @@ -225,23 +224,6 @@ func main() {
if !slices.Contains(autoApprovePkgs, "rules") {
rulep.RequireApproval()
}
if true { // TODO: remove once launched
if _, ok := g.db.Get(ordered.Encode("github.EventWatcher", "rules.Poster:rules")); !ok {
// For testing (and startup). Set a timestamp 1 hour before
// the related issue poster.
qq, ok := g.db.Get(ordered.Encode("github.EventWatcher", "related.Poster:related"))
if !ok {
panic("can't find key")
}
var t int64
err := ordered.Decode(qq, &t)
if err != nil {
panic(err)
}
t -= 5 * 60 * 60 * 1e9 // back up 1 hour
g.db.Set(ordered.Encode("github.EventWatcher", "rules.Poster:rules"), ordered.Encode(t))
}
}
g.rulesPoster = rulep

// Named functions to retrieve latest Watcher times.
Expand Down

0 comments on commit 7a94449

Please sign in to comment.