MCPcopy Index your code
hub / github.com/coder/coder / init

Method init

coderd/updatecheck/updatecheck.go:112–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110}
111
112func (c *Checker) init() (Result, error) {
113 defer close(c.firstCheck)
114
115 r, err := c.lastUpdateCheck(c.ctx)
116 if err != nil && !xerrors.Is(err, sql.ErrNoRows) {
117 return Result{}, xerrors.Errorf("last update check: %w", err)
118 }
119 if r.Checked.IsZero() || time.Since(r.Checked) > c.opts.Interval {
120 r, err = c.update()
121 if err != nil {
122 return Result{}, xerrors.Errorf("update check failed: %w", err)
123 }
124 }
125
126 return r, nil
127}
128
129func (c *Checker) start() {
130 defer close(c.closed)

Callers 1

startMethod · 0.95

Calls 5

lastUpdateCheckMethod · 0.95
updateMethod · 0.95
IsMethod · 0.45
ErrorfMethod · 0.45
IsZeroMethod · 0.45

Tested by

no test coverage detected