Addresing new comments

This commit is contained in:
Denis Makogon
2017-09-07 15:16:18 +03:00
parent 57a577dfc9
commit 8a337e744b
2 changed files with 6 additions and 2 deletions

View File

@@ -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)

View File

@@ -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")
} }
} }