Skip to content

Commit

Permalink
fix(cross-region-prop): fixing standards
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0elliot committed Mar 7, 2024
1 parent 0ee2fd9 commit eb644c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions db-connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -3483,8 +3483,8 @@ func propagateOrg(org Org) error {
return errors.New("no ID provided for org")
}

if len(propagateUrl) == 0 {
return errors.New("no PROPAGATE_URL provided")
if len(propagateUrl) == 0 || len(propagateToken) == 0 {
return errors.New("no SHUFFLE_PROPAGATE_URL or SHUFFLE_PROPAGATE_TOKEN provided")
}

log.Printf("[INFO] Asking %s to propagate org %s", propagateUrl, org.Id)
Expand Down Expand Up @@ -3516,7 +3516,7 @@ func propagateOrg(org Org) error {

// Check the response
if resp.StatusCode != 200 {
log.Printf("[WARNING] Error in propagation: %s with body: %s for org %s", resp.Status, resp.Body, org.Id)
log.Printf("[WARNING] Error in propagation: %s for org %s", resp.Status, org.Id)
return errors.New(fmt.Sprintf("bad statuscode: %d", resp.StatusCode))
}

Expand All @@ -3528,8 +3528,8 @@ func propagateUser(user User) error {
return errors.New("no ID provided for user")
}

if len(propagateUrl) == 0 {
return errors.New("no PROPAGATE_URL provided")
if len(propagateUrl) == 0 || len(propagateToken) == 0 {
return errors.New("no SHUFFLE_PROPAGATE_URL or SHUFFLE_PROPAGATE_TOKEN provided")
}

log.Printf("[INFO] Asking %s to propagate user %s", propagateUrl, user.Id)
Expand Down Expand Up @@ -3562,7 +3562,7 @@ func propagateUser(user User) error {

// Check the response
if resp.StatusCode != 200 {
log.Printf("[WARNING] Error in propagation: %s with body: %s for user %s", resp.Status, resp.Body, user.Id)
log.Printf("[WARNING] Error in propagation: %s for user %s", resp.Status, user.Id)
return errors.New(fmt.Sprintf("bad statuscode: %d", resp.StatusCode))
}

Expand Down

0 comments on commit eb644c5

Please sign in to comment.