From 7b359b19f78516adf286cbe1b7d56dabab08e70f Mon Sep 17 00:00:00 2001 From: Joel Andritsch Date: Fri, 22 Apr 2022 04:17:48 -0500 Subject: [PATCH] bugfix: Add delay between create and update calls (#174) This helps mitigate a 409 conflict response from Confluence when creating a new page and then updating it right away. This may not be the cleanest solution, but it seems to do the trick. Resolves #139 --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 2194ef5..9e92167 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "io/ioutil" "os" "path/filepath" + "time" "github.com/docopt/docopt-go" "github.com/kovetskiy/lorg" @@ -306,6 +307,10 @@ func processFile( meta.Title, ) } + // (issues/139): A delay between the create and update call + // helps mitigate a 409 conflict that can occur when attempting + // to update a page just after it was created. + time.Sleep(1 * time.Second) } target = page