feat: create profiling package + rewrite profiling tutorial
Some checks reported warnings
Cadoles/bouncer/pipeline/head This commit was not built
Some checks reported warnings
Cadoles/bouncer/pipeline/head This commit was not built
This commit is contained in:
@ -36,7 +36,7 @@ func (r *LayerRepository) CreateLayer(ctx context.Context, proxyName store.Proxy
|
||||
|
||||
CreatedAt: wrap(now),
|
||||
UpdatedAt: wrap(now),
|
||||
Options: wrap(store.LayerOptions{}),
|
||||
Options: wrap(options),
|
||||
}
|
||||
|
||||
txf := func(tx *redis.Tx) error {
|
||||
@ -60,6 +60,11 @@ func (r *LayerRepository) CreateLayer(ctx context.Context, proxyName store.Proxy
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
|
||||
layerItem, err = r.txGetLayerItem(ctx, tx, proxyName, layerName)
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -70,16 +75,16 @@ func (r *LayerRepository) CreateLayer(ctx context.Context, proxyName store.Proxy
|
||||
|
||||
return &store.Layer{
|
||||
LayerHeader: store.LayerHeader{
|
||||
Name: layerName,
|
||||
Proxy: proxyName,
|
||||
Type: layerType,
|
||||
Weight: 0,
|
||||
Enabled: false,
|
||||
Name: store.LayerName(layerItem.Name),
|
||||
Proxy: store.ProxyName(layerItem.Proxy),
|
||||
Type: store.LayerType(layerItem.Type),
|
||||
Weight: layerItem.Weight,
|
||||
Enabled: layerItem.Enabled,
|
||||
},
|
||||
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
Options: store.LayerOptions{},
|
||||
CreatedAt: layerItem.CreatedAt.Value(),
|
||||
UpdatedAt: layerItem.UpdatedAt.Value(),
|
||||
Options: layerItem.Options.Value(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user