From a97a1d7d5d5c81cab948a1e9b2198a61e9856d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Behrendt?= Date: Mon, 25 Nov 2019 10:06:13 +0100 Subject: [PATCH 1/2] Speedup upload cleanup by increasing per_page keys --- upload_cleanup.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/upload_cleanup.go b/upload_cleanup.go index 467542c..fd3a80d 100644 --- a/upload_cleanup.go +++ b/upload_cleanup.go @@ -28,11 +28,9 @@ func (cmd *UploadCleanupCommand) Run() error { func UploadCleanup(client *phraseapp.Client, cmd *UploadCleanupCommand) error { q := "unmentioned_in_upload:" + cmd.ID params := &phraseapp.KeysListParams{Q: &q} - - var err error page := 1 - keys, err := client.KeysList(cmd.Config.DefaultProjectID, page, 25, params) + keys, err := client.KeysList(cmd.Config.DefaultProjectID, page, 100, params) if err != nil { return err } @@ -43,8 +41,8 @@ func UploadCleanup(client *phraseapp.Client, cmd *UploadCleanupCommand) error { } for len(keys) != 0 { - ids := make([]string, len(keys), len(keys)) - names := make([]string, len(keys), len(keys)) + ids := make([]string, len(keys)) + names := make([]string, len(keys)) for i, key := range keys { ids[i] = key.ID names[i] = key.Name @@ -79,7 +77,7 @@ func UploadCleanup(client *phraseapp.Client, cmd *UploadCleanupCommand) error { fmt.Printf("%d key(s) successfully deleted.\n", affected.RecordsAffected) page++ - keys, _ = client.KeysList(cmd.Config.DefaultProjectID, page, 25, params) + keys, _ = client.KeysList(cmd.Config.DefaultProjectID, page, 100, params) } return nil From 291fb995861e034bba04f4e080ea4149f84eaac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Behrendt?= Date: Mon, 25 Nov 2019 10:14:11 +0100 Subject: [PATCH 2/2] Update to 1.16.1 --- .version | 2 +- build/innosetup/phraseapp-client-386.iss | 2 +- build/innosetup/phraseapp-client.iss | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.version b/.version index 15b989e..41c11ff 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -1.16.0 +1.16.1 diff --git a/build/innosetup/phraseapp-client-386.iss b/build/innosetup/phraseapp-client-386.iss index 7198250..ef1a842 100644 --- a/build/innosetup/phraseapp-client-386.iss +++ b/build/innosetup/phraseapp-client-386.iss @@ -7,7 +7,7 @@ ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{DC598D8E-8A9B-4CAD-AFD8-0324FDF4E0F1} AppName=PhraseApp Client -AppVersion=1.16.0 +AppVersion=1.16.1 AppPublisher=PhraseApp GmbH AppPublisherURL=https://phrase.com/cli AppSupportURL=https://phrase.com/cli diff --git a/build/innosetup/phraseapp-client.iss b/build/innosetup/phraseapp-client.iss index af570a0..807d922 100644 --- a/build/innosetup/phraseapp-client.iss +++ b/build/innosetup/phraseapp-client.iss @@ -7,7 +7,7 @@ ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{DC598D8E-8A9B-4CAD-AFD8-0324FDF4E0F1} AppName=PhraseApp Client -AppVersion=1.16.0 +AppVersion=1.16.1 AppPublisher=PhraseApp GmbH AppPublisherURL=https://phrase.com/cli AppSupportURL=https://phrase.com/cli