mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-24 22:06:57 +00:00
fix lint issue
This commit is contained in:
parent
9629df54b2
commit
29e147d5c3
2 changed files with 3 additions and 15 deletions
|
@ -11,7 +11,7 @@ pipeline:
|
||||||
- go version
|
- go version
|
||||||
- go install mvdan.cc/gofumpt@latest
|
- go install mvdan.cc/gofumpt@latest
|
||||||
- "[ $(gofumpt -extra -l . | wc -l) != 0 ] && { echo 'code not formated'; exit 1; }"
|
- "[ $(gofumpt -extra -l . | wc -l) != 0 ] && { echo 'code not formated'; exit 1; }"
|
||||||
- golangci-lint run -v
|
- golangci-lint run
|
||||||
|
|
||||||
# # TODO: make tests work
|
# # TODO: make tests work
|
||||||
# test:
|
# test:
|
||||||
|
|
|
@ -13,6 +13,8 @@ import (
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var _ CertDB = aDB{}
|
||||||
|
|
||||||
type aDB struct {
|
type aDB struct {
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
cancel context.CancelFunc
|
cancel context.CancelFunc
|
||||||
|
@ -76,20 +78,6 @@ func (p aDB) sync() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p aDB) compact() {
|
|
||||||
for {
|
|
||||||
err := p.intern.Sync()
|
|
||||||
if err != nil {
|
|
||||||
log.Err(err).Msg("Syncing cert database failed")
|
|
||||||
}
|
|
||||||
select {
|
|
||||||
case <-p.ctx.Done():
|
|
||||||
return
|
|
||||||
case <-time.After(p.syncInterval):
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func New(path string) (CertDB, error) {
|
func New(path string) (CertDB, error) {
|
||||||
if path == "" {
|
if path == "" {
|
||||||
return nil, fmt.Errorf("path not set")
|
return nil, fmt.Errorf("path not set")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue