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
This commit is contained in:
Joel Andritsch 2022-04-22 04:17:48 -05:00 committed by GitHub
parent 5ad1a4abe5
commit 7b359b19f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"time"
"github.com/docopt/docopt-go" "github.com/docopt/docopt-go"
"github.com/kovetskiy/lorg" "github.com/kovetskiy/lorg"
@ -306,6 +307,10 @@ func processFile(
meta.Title, 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 target = page