mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-03 16:38:31 +00:00
convert baseURL
This commit is contained in:
parent
dd9e66c80d
commit
24936a6543
1 changed files with 5 additions and 6 deletions
|
@ -40,7 +40,6 @@ type backendInfo struct {
|
||||||
|
|
||||||
var Backend *backendInfo
|
var Backend *backendInfo
|
||||||
|
|
||||||
var backendURL string
|
|
||||||
var responseCache *cache.Cache
|
var responseCache *cache.Cache
|
||||||
|
|
||||||
var postStatisticsURL string
|
var postStatisticsURL string
|
||||||
|
@ -57,15 +56,15 @@ func setupBackend(config *ConfigFile) *backendInfo {
|
||||||
b.serverID = config.ServerID
|
b.serverID = config.ServerID
|
||||||
|
|
||||||
b.HTTPClient.Timeout = 60 * time.Second
|
b.HTTPClient.Timeout = 60 * time.Second
|
||||||
backendURL = config.BackendURL
|
b.baseURL = config.BackendURL
|
||||||
if responseCache != nil {
|
if responseCache != nil {
|
||||||
responseCache.Flush()
|
responseCache.Flush()
|
||||||
}
|
}
|
||||||
responseCache = cache.New(60*time.Second, 120*time.Second)
|
responseCache = cache.New(60*time.Second, 120*time.Second)
|
||||||
|
|
||||||
announceStartupURL = fmt.Sprintf("%s%s", backendURL, bPathAnnounceStartup)
|
announceStartupURL = fmt.Sprintf("%s%s", b.baseURL, bPathAnnounceStartup)
|
||||||
addTopicURL = fmt.Sprintf("%s%s", backendURL, bPathAddTopic)
|
addTopicURL = fmt.Sprintf("%s%s", b.baseURL, bPathAddTopic)
|
||||||
postStatisticsURL = fmt.Sprintf("%s%s", backendURL, bPathAggStats)
|
postStatisticsURL = fmt.Sprintf("%s%s", b.baseURL, bPathAggStats)
|
||||||
epochTime := time.Unix(0, 0)
|
epochTime := time.Unix(0, 0)
|
||||||
lastBackendSuccess = map[string]time.Time{
|
lastBackendSuccess = map[string]time.Time{
|
||||||
bPathAnnounceStartup: epochTime,
|
bPathAnnounceStartup: epochTime,
|
||||||
|
@ -168,7 +167,7 @@ func (backend *backendInfo) SendRemoteCommandCached(remoteCommand, data string,
|
||||||
// (should be retrieved from ClientMessage.Arguments), and either `username` or
|
// (should be retrieved from ClientMessage.Arguments), and either `username` or
|
||||||
// `usernameClaimed` depending on whether AuthInfo.UsernameValidates is true is AuthInfo.TwitchUsername.
|
// `usernameClaimed` depending on whether AuthInfo.UsernameValidates is true is AuthInfo.TwitchUsername.
|
||||||
func (backend *backendInfo) SendRemoteCommand(remoteCommand, data string, auth AuthInfo) (responseStr string, err error) {
|
func (backend *backendInfo) SendRemoteCommand(remoteCommand, data string, auth AuthInfo) (responseStr string, err error) {
|
||||||
destURL := fmt.Sprintf("%s/cmd/%s", backendURL, remoteCommand)
|
destURL := fmt.Sprintf("%s/cmd/%s", backend.baseURL, remoteCommand)
|
||||||
|
|
||||||
formData := url.Values{
|
formData := url.Values{
|
||||||
"clientData": []string{data},
|
"clientData": []string{data},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue