Compare commits

..

8 Commits
v1.3.0 ... main

Author SHA1 Message Date
b055a7de1c
Add .drone.yml 2022-10-26 16:15:40 +02:00
f857d22142 Merge pull request 'Configure Renovate' (#1) from renovate/configure into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #1
2022-10-26 10:16:22 +00:00
b81d5a8988 Add renovate.json
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-10-26 10:03:39 +00:00
db85184dca
Add .drone.yml
Some checks reported errors
continuous-integration/drone Build encountered an error
2022-10-26 11:29:16 +02:00
a59a278140
with callback instead 2022-09-21 22:19:54 +02:00
4774158f24
with stop 2022-09-21 22:14:22 +02:00
5f89d83094
with defer 2022-09-21 22:08:27 +02:00
f9109382cb
components signal 2022-09-21 21:45:48 +02:00
3 changed files with 45 additions and 21 deletions

9
.drone.yml Executable file
View File

@ -0,0 +1,9 @@
kind: pipeline
type: docker
name: "test"
steps:
- name: test
image: harbor.front.kjuulh.io/docker-proxy/library/bash:latest
commands:
- echo 'Run tests'

View File

@ -4,6 +4,7 @@ import (
"context"
"os"
"sync"
"time"
)
const (
@ -33,7 +34,10 @@ func NewManager() *Manager {
type ComponentsAreReady struct {
}
func (m *Manager) RunNonBlocking(ctx context.Context) error {
type CleanupFunc func(ctx context.Context) error
func (m *Manager) RunNonBlocking(ctx context.Context, readyChan chan ComponentsAreReady) (CleanupFunc, error) {
go func() error {
m.initLifetime()
err := m.init(ctx)
if err != nil {
@ -45,16 +49,19 @@ func (m *Manager) RunNonBlocking(ctx context.Context) error {
return err
}
readyChan <- ComponentsAreReady{}
err = m.wait(ctx)
if err != nil {
return err
}
err = m.shutdown(ctx)
if err != nil {
return err
}
return nil
}()
return func(ctx context.Context) error {
return m.shutdown(ctx)
}, nil
}
func (m *Manager) Run(ctx context.Context) error {
@ -157,9 +164,14 @@ func (m *Manager) initLifetime() {
}
func (m *Manager) wait(ctx context.Context) error {
exitCode := <-m.exitChan
select {
case exitCode := <-m.exitChan:
m.exitCode = exitCode
return nil
case <-ctx.Done():
return nil
}
return nil
}
func (m *Manager) shutdown(ctx context.Context) error {

3
renovate.json Normal file
View File

@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}