[#25] Migrate cmd/gate to NeoFS API v2
Naive migration, without any tries to start application closes #25 Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
This commit is contained in:
parent
b72a957341
commit
424fb7a1d1
1 changed files with 15 additions and 1 deletions
|
@ -3,8 +3,10 @@ package main
|
|||
import (
|
||||
"context"
|
||||
"crypto/ecdsa"
|
||||
"errors"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/nspcc-dev/neofs-authmate/accessbox/hcs"
|
||||
|
@ -148,12 +150,24 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App {
|
|||
cli.ReBalance(ctx)
|
||||
|
||||
if _, err = cli.Connection(ctx); err != nil {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
l.Info("connection canceled")
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
l.Fatal("could not establish connection",
|
||||
zap.Error(err))
|
||||
}
|
||||
}
|
||||
|
||||
if obj, err = layer.NewLayer(l, cli, nfKey); err != nil {
|
||||
layerParams := &layer.Params{
|
||||
Pool: cli,
|
||||
Logger: l,
|
||||
Timeout: reqTimeout,
|
||||
NFKey: nfKey,
|
||||
}
|
||||
|
||||
if obj, err = layer.NewLayer(layerParams); err != nil {
|
||||
l.Fatal("could not prepare ObjectLayer", zap.Error(err))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue