Skip to content

Commit

Permalink
Revert "feat: support polaris service governance"
Browse files Browse the repository at this point in the history
This reverts commit b67d514.
  • Loading branch information
shenqidebaozi committed Dec 20, 2022
1 parent b67d514 commit a45f3af
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 1,837 deletions.
20 changes: 6 additions & 14 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,12 @@ func (a *App) Run() error {
})
}
wg.Wait()
if a.opts.registrars != nil {
if a.opts.registrar != nil {
rctx, rcancel := context.WithTimeout(ctx, a.opts.registrarTimeout)
defer rcancel()

for _, registrar := range a.opts.registrars {
if err = registrar.Register(rctx, instance); err != nil {
return err
}
if err = a.opts.registrar.Register(rctx, instance); err != nil {
return err
}

}
for _, fn := range a.opts.afterStart {
if err = fn(sctx); err != nil {
Expand Down Expand Up @@ -159,16 +155,12 @@ func (a *App) Stop() (err error) {
a.mu.Lock()
instance := a.instance
a.mu.Unlock()
if a.opts.registrars != nil && instance != nil {
if a.opts.registrar != nil && instance != nil {
ctx, cancel := context.WithTimeout(NewContext(a.ctx, a), a.opts.registrarTimeout)
defer cancel()

for _, registrar := range a.opts.registrars {
if err = registrar.Deregister(ctx, instance); err != nil {
return err
}
if err = a.opts.registrar.Deregister(ctx, instance); err != nil {
return err
}

}
if a.cancel != nil {
a.cancel()
Expand Down
172 changes: 0 additions & 172 deletions contrib/polaris/config.go

This file was deleted.

Loading

0 comments on commit a45f3af

Please sign in to comment.