upgraded to latest lbry.go reorg part 2
This commit is contained in:
parent
4789f894b8
commit
01bbe95226
5 changed files with 10 additions and 9 deletions
11
main.go
11
main.go
|
@ -11,6 +11,7 @@ import (
|
||||||
"github.com/lbryio/ytsync/sdk"
|
"github.com/lbryio/ytsync/sdk"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
"github.com/lbryio/ytsync/manager"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -85,8 +86,8 @@ func ytSync(cmd *cobra.Command, args []string) {
|
||||||
util.InitSlack(os.Getenv("SLACK_TOKEN"), os.Getenv("SLACK_CHANNEL"), hostname)
|
util.InitSlack(os.Getenv("SLACK_TOKEN"), os.Getenv("SLACK_CHANNEL"), hostname)
|
||||||
}
|
}
|
||||||
|
|
||||||
if syncStatus != "" && !util.InSlice(syncStatus, SyncStatuses) {
|
if syncStatus != "" && !util.InSlice(syncStatus, manager.SyncStatuses) {
|
||||||
log.Errorf("status must be one of the following: %v\n", SyncStatuses)
|
log.Errorf("status must be one of the following: %v\n", manager.SyncStatuses)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +165,7 @@ func ytSync(cmd *cobra.Command, args []string) {
|
||||||
ApiToken: apiToken,
|
ApiToken: apiToken,
|
||||||
HostName: hostname,
|
HostName: hostname,
|
||||||
}
|
}
|
||||||
sm := NewSyncManager(
|
sm := manager.NewSyncManager(
|
||||||
stopOnError,
|
stopOnError,
|
||||||
maxTries,
|
maxTries,
|
||||||
takeOverExistingChannel,
|
takeOverExistingChannel,
|
||||||
|
@ -190,7 +191,7 @@ func ytSync(cmd *cobra.Command, args []string) {
|
||||||
)
|
)
|
||||||
err := sm.Start()
|
err := sm.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
SendErrorToSlack(err.Error())
|
manager.SendErrorToSlack(err.Error())
|
||||||
}
|
}
|
||||||
SendInfoToSlack("Syncing process terminated!")
|
manager.SendInfoToSlack("Syncing process terminated!")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package manager
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package manager
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package manager
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package manager
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
Loading…
Reference in a new issue