From ebf00227b8b5923e7a4bb7ee8e6e01e972fbe9c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B8=CC=86=20=D0=9A=D0=B2?= =?UTF-8?q?=D0=B0=D1=80=D1=82=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2?= Date: Thu, 1 Oct 2020 23:09:49 +0300 Subject: [PATCH] Fixed export params --- export.go | 3 +-- users.go | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/export.go b/export.go index a06dad5..26f02f8 100644 --- a/export.go +++ b/export.go @@ -53,6 +53,7 @@ func (e *Export) WaitExportComplete(ctx context.Context, jobID int) (*ExportStat ) t := time.NewTicker(emarsysUpdateStatusPeriod) + defer t.Stop() for { select { @@ -64,8 +65,6 @@ func (e *Export) WaitExportComplete(ctx context.Context, jobID int) (*ExportStat status, err = e.CheckStatus(jobID) if err != nil { - t.Stop() - return nil, err } diff --git a/users.go b/users.go index 5db0b27..0021513 100644 --- a/users.go +++ b/users.go @@ -34,6 +34,8 @@ const ( PlatformOriginAll = "all" PlatformDefaultOriginID = "0" ExportDistributionMethodLocal = "local" + + defaultCSVDelimiter = "," ) type Users struct { @@ -475,6 +477,7 @@ func (u *Users) GetSegmentLocally(segmentID int, fields []int) (*ExportResult, e DistributionMethod: ExportDistributionMethodLocal, ContactFields: fields, AddFieldNamesHeader: 1, + Delimiter: defaultCSVDelimiter, }, Filter: segmentID, }) @@ -486,6 +489,7 @@ func (u *Users) GetAllChangesLocally(startTime, endTime time.Time, fields []int) DistributionMethod: ExportDistributionMethodLocal, ContactFields: fields, AddFieldNamesHeader: 1, + Delimiter: defaultCSVDelimiter, }, Origin: PlatformOriginAll, TimeRange: []string{