71
// Please make sure your implementation is lossless. If any in-memory batching mechanism is used, then those batched records will be lost during server restarts.
72
// This method will be invoked when workflow closes. Note that because of conflict resolution, it is possible for a workflow to through the closing process multiple times, which means that this method can be invoked more than once after a workflow closes.
73
>
func (v *visibilityArchiver) Archive(ctx context.Context, URI archiver.URI, request *archiverspb.VisibilityRecord, opts ...archiver.ArchiveOption) (err error) {
visibility_archiver.go
74
>
handler := v.metricsHandler.WithTags(metrics.OperationTag(metrics.HistoryArchiverScope), metrics.NamespaceTag(request.Namespace))
75
>
featureCatalog := archiver.GetFeatureCatalog(opts...)
76
>
startTime := time.Now().UTC()
77
>
defer func() {
78
>
metrics.ServiceLatency.With(handler).Record(time.Since(startTime))
79
>
if err != nil {
80
if isRetryableError(err) {
81
metrics.VisibilityArchiverArchiveTransientErrorCount.With(handler).Record(1)