Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maintenance check in TibiadataHTMLDataCollectorV3 #9

Closed
tobiasehlert opened this issue Dec 30, 2021 · 1 comment · Fixed by #34
Closed

Add maintenance check in TibiadataHTMLDataCollectorV3 #9

tobiasehlert opened this issue Dec 30, 2021 · 1 comment · Fixed by #34
Labels
enhancement New feature or request

Comments

@tobiasehlert
Copy link
Member

We need to have some way to detect maintenance mode and return some proper message.
This should be done in the TibiadataHTMLDataCollectorV3 function or somewhere more suitable.

Here is some initial logging at least:

// Check if page is in maintenance mode
if res.StatusCode() == 302 {
log.Printf("[info] TibiadataHTMLDataCollectorV3 (URL: %s): Page tibia.com returns 302, probably maintenance mode enabled. ", TibiaURL)
// TODO
// do response with maintenance mode..
}

tobiasehlert added a commit that referenced this issue Dec 30, 2021
tobiasehlert added a commit that referenced this issue Jan 2, 2022
@tobiasehlert tobiasehlert added the enhancement New feature or request label Jan 3, 2022
@tobiasehlert tobiasehlert linked a pull request Jan 12, 2022 that will close this issue
@tobiasehlert
Copy link
Member Author

This has been fixed in #34.

case http.StatusFound:
// Check if page is in maintenance mode
location, _ := res.RawResponse.Location()
if location.Host == "maintenance.tibia.com" {
LogMessage := "maintenance mode detected on tibia.com"
log.Printf("[info] TibiadataHTMLDataCollectorV3: %s!", LogMessage)
return "", errors.New(LogMessage)
}
fallthrough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

1 participant