Sync: Download to temp path #225

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer
2020-04-06 16:34:29 +02:00
parent 9b7a5d69d4
commit 087c56e371
11 changed files with 89 additions and 22 deletions

View File

@@ -11,8 +11,9 @@ import (
var log = event.Log
var stop = make(chan bool, 1)
// Start runs the service workers every 10 minutes.
func Start(conf *config.Config) {
ticker := time.NewTicker(15 * time.Minute)
ticker := time.NewTicker(10 * time.Minute)
go func() {
for {
@@ -31,6 +32,12 @@ func Start(conf *config.Config) {
}()
}
// Stop shuts down all service workers.
func Stop() {
stop <- true
}
// StartShare runs the share worker once.
func StartShare(conf *config.Config) {
if !mutex.Share.Busy() {
go func() {
@@ -42,6 +49,7 @@ func StartShare(conf *config.Config) {
}
}
// StartShare runs the sync worker once.
func StartSync(conf *config.Config) {
if !mutex.Sync.Busy() {
go func() {
@@ -52,7 +60,3 @@ func StartSync(conf *config.Config) {
}()
}
}
func Stop() {
stop <- true
}