mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Addresing new comments
This commit is contained in:
@@ -222,7 +222,8 @@ func (a *agent) Submit(callI Call) error {
|
|||||||
|
|
||||||
a.stats.Complete()
|
a.stats.Complete()
|
||||||
|
|
||||||
// TODO if the context is timed out here we need to allocate new one
|
// TODO: we need to allocate more time to store the call + logs in case the call timed out,
|
||||||
|
// but this could put us over the timeout if the call did not reply yet (need better policy).
|
||||||
ctx = opentracing.ContextWithSpan(context.Background(), span)
|
ctx = opentracing.ContextWithSpan(context.Background(), span)
|
||||||
call.End(ctx, err)
|
call.End(ctx, err)
|
||||||
|
|
||||||
|
|||||||
@@ -287,7 +287,10 @@ func (c *call) End(ctx context.Context, err error) {
|
|||||||
// XXX (reed): delete MQ message, eventually
|
// XXX (reed): delete MQ message, eventually
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := c.ds.InsertCall(opentracing.ContextWithSpan(ctx, span), c.Call); err != nil {
|
// this means that we could potentially store an error / timeout status for a
|
||||||
|
// call that ran successfully [by a user's perspective]
|
||||||
|
// TODO: this should be update, really
|
||||||
|
if err := c.ds.InsertCall(ctx, c.Call); err != nil {
|
||||||
logrus.WithError(err).Error("error inserting call into datastore")
|
logrus.WithError(err).Error("error inserting call into datastore")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user