You've already forked golang-saas-starter-kit
mirror of
https://github.com/raseels-repos/golang-saas-starter-kit.git
synced 2025-08-08 22:36:41 +02:00
Add more comment
This commit is contained in:
@ -339,6 +339,8 @@ func GetGeonameCountry(ctx context.Context, country string) ([]Geoname, error) {
|
|||||||
u := fmt.Sprintf("http://download.geonames.org/export/zip/%s.zip", country)
|
u := fmt.Sprintf("http://download.geonames.org/export/zip/%s.zip", country)
|
||||||
resp, err = pester.Get(u)
|
resp, err = pester.Get(u)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// Add re-try three times after failing first time
|
||||||
|
// This reduces the risk when network is lagy, we still have chance to re-try.
|
||||||
for i := 0; i < 3; i++ {
|
for i := 0; i < 3; i++ {
|
||||||
resp, err = pester.Get(u)
|
resp, err = pester.Get(u)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
@ -293,7 +293,7 @@ func migrationList(ctx context.Context, db *sqlx.DB, log *log.Logger, isUnittest
|
|||||||
return errors.WithStack(err)
|
return errors.WithStack(err)
|
||||||
}
|
}
|
||||||
//fmt.Println("Geoname records: ", len(v))
|
//fmt.Println("Geoname records: ", len(v))
|
||||||
|
// Max argument values of Postgres is about 54460. So the batch size for bulk insert is selected 4500*12 (ncol)
|
||||||
batch := 4500
|
batch := 4500
|
||||||
n := len(v) / batch
|
n := len(v) / batch
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user