mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Use context logging more to ensure context vars are present in log lines (#1039)
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/fnproject/fn/api/models"
|
||||
|
||||
"github.com/fnproject/fn/api/common"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -26,10 +27,11 @@ func NewNaivePlacer() Placer {
|
||||
|
||||
func (sp *naivePlacer) PlaceCall(rp RunnerPool, ctx context.Context, call RunnerCall) error {
|
||||
|
||||
log := common.Logger(ctx)
|
||||
for {
|
||||
runners, err := rp.Runners(call)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Error("Failed to find runners for call")
|
||||
log.WithError(err).Error("Failed to find runners for call")
|
||||
} else {
|
||||
for j := 0; j < len(runners); j++ {
|
||||
|
||||
@@ -47,7 +49,7 @@ func (sp *naivePlacer) PlaceCall(rp RunnerPool, ctx context.Context, call Runner
|
||||
tryCancel()
|
||||
|
||||
if err != nil && err != models.ErrCallTimeoutServerBusy {
|
||||
logrus.WithError(err).Error("Failed during call placement")
|
||||
log.WithError(err).Error("Failed during call placement")
|
||||
}
|
||||
if placed {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user