Fix lint errors

This commit is contained in:
Abdul Rabbani 2022-05-12 09:26:59 -04:00
parent 346e1e8083
commit 5fc3ec3172
5 changed files with 5 additions and 4 deletions

View File

@ -26,7 +26,7 @@ func ShutdownServices(ctx context.Context, notifierCh chan os.Signal, waitTime t
}) })
select { select {
case _ = <-successCh: case <-successCh:
return nil return nil
case err := <-errCh: case err := <-errCh:
return err return err

Binary file not shown.

View File

@ -236,6 +236,7 @@ func (ps *ProcessSlot) createWriteObjects() *DatabaseWriter {
if ps.BlockRoot != "" { if ps.BlockRoot != "" {
blockRoot = ps.BlockRoot blockRoot = ps.BlockRoot
} else { } else {
log.Info("We need to add logic")
// We need to get the state of Slot + 1, then we can run the below. // We need to get the state of Slot + 1, then we can run the below.
// WE can query it for each run, or we can leave it blank, and update it. // WE can query it for each run, or we can leave it blank, and update it.
// I just want to avoid getting the same state twice, especially since the state can get heavy. // I just want to avoid getting the same state twice, especially since the state can get heavy.

View File

@ -29,17 +29,18 @@ var _ = Describe("Pgx", func() {
_, err := postgres.NewPostgresDB(postgres.Config{ _, err := postgres.NewPostgresDB(postgres.Config{
Driver: "PGX", Driver: "PGX",
}) })
Expect(err).NotTo(BeNil()) Expect(err).NotTo(HaveOccurred())
present, err := doesContainsSubstring(err.Error(), sql.DbConnectionFailedMsg) present, err := doesContainsSubstring(err.Error(), sql.DbConnectionFailedMsg)
Expect(present).To(BeTrue()) Expect(present).To(BeTrue())
Expect(err).NotTo(HaveOccurred())
}) })
}) })
Context("The connection is successful", func() { Context("The connection is successful", func() {
It("Should create a DB object", func() { It("Should create a DB object", func() {
db, err := postgres.NewPostgresDB(postgres.DefaultConfig) db, err := postgres.NewPostgresDB(postgres.DefaultConfig)
defer db.Close()
Expect(err).To(BeNil()) Expect(err).To(BeNil())
defer db.Close()
}) })
}) })
}) })

View File

@ -38,7 +38,6 @@ func Shutdown(ctx context.Context, notifierCh chan os.Signal, timeout time.Durat
timeoutFunc := time.AfterFunc(timeout, func() { timeoutFunc := time.AfterFunc(timeout, func() {
log.Warnf(TimeoutErr(timeout.String()).Error()) log.Warnf(TimeoutErr(timeout.String()).Error())
errCh <- TimeoutErr(timeout.String()) errCh <- TimeoutErr(timeout.String())
return
}) })
defer timeoutFunc.Stop() defer timeoutFunc.Stop()