mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-16 23:16:48 +00:00
Shortens notification time
Separates bot configuration to its own method to allow for repeat use. Also main.go should be small Now reloads bot configuration on the save post. Active changes!
This commit is contained in:
@@ -43,6 +43,7 @@ func SaveAllSettings(w http.ResponseWriter, r *http.Request) {
|
||||
log.Println("Fatal error checking config values. Error:", err)
|
||||
panic(err)
|
||||
}
|
||||
setupBotExchanges()
|
||||
//Return response status
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
||||
20
main.go
20
main.go
@@ -40,6 +40,24 @@ type Bot struct {
|
||||
|
||||
var bot Bot
|
||||
|
||||
func setupBotExchanges() {
|
||||
for _, exch := range bot.config.Exchanges {
|
||||
for i := 0; i < len(bot.exchanges); i++ {
|
||||
if bot.exchanges[i] != nil {
|
||||
if bot.exchanges[i].GetName() == exch.Name {
|
||||
bot.exchanges[i].Setup(exch)
|
||||
if bot.exchanges[i].IsEnabled() {
|
||||
log.Printf("%s: Exchange support: %s (Authenticated API support: %s - Verbose mode: %s).\n", exch.Name, IsEnabled(exch.Enabled), IsEnabled(exch.AuthenticatedAPISupport), IsEnabled(exch.Verbose))
|
||||
bot.exchanges[i].Start()
|
||||
} else {
|
||||
log.Printf("%s: Exchange support: %s\n", exch.Name, IsEnabled(exch.Enabled))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
HandleInterrupt()
|
||||
log.Println("Loading config file config.json..")
|
||||
@@ -103,6 +121,8 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
setupBotExchanges()
|
||||
|
||||
err = RetrieveConfigCurrencyPairs(bot.config)
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -11,7 +11,7 @@ angular.module('myApp', [
|
||||
]).
|
||||
config(['$locationProvider', '$routeProvider' ,'NotificationProvider', function($locationProvider, $routeProvider, NotificationProvider) {
|
||||
NotificationProvider.setOptions({
|
||||
delay: 10000,
|
||||
delay: 5000,
|
||||
startTop: 60,
|
||||
startRight: 10,
|
||||
verticalSpacing: 10,
|
||||
|
||||
Reference in New Issue
Block a user