mirror of
https://github.com/tuna/tunasync.git
synced 2025-06-14 13:32:43 +00:00
Run go fmt
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
This commit is contained in:
parent
99c7ab6b65
commit
ef32197fef
@ -9,10 +9,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/pkg/profile"
|
|
||||||
"gopkg.in/op/go-logging.v1"
|
|
||||||
"github.com/urfave/cli"
|
|
||||||
"github.com/moby/moby/pkg/reexec"
|
"github.com/moby/moby/pkg/reexec"
|
||||||
|
"github.com/pkg/profile"
|
||||||
|
"github.com/urfave/cli"
|
||||||
|
"gopkg.in/op/go-logging.v1"
|
||||||
|
|
||||||
tunasync "github.com/tuna/tunasync/internal"
|
tunasync "github.com/tuna/tunasync/internal"
|
||||||
"github.com/tuna/tunasync/manager"
|
"github.com/tuna/tunasync/manager"
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
//go:build ignore
|
||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
//go:build ignore
|
||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
//go:build ignore
|
||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
//go:build ignore
|
||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
//go:build linux
|
||||||
// +build linux
|
// +build linux
|
||||||
|
|
||||||
package worker
|
package worker
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
//go:build !linux
|
||||||
// +build !linux
|
// +build !linux
|
||||||
|
|
||||||
package worker
|
package worker
|
||||||
|
@ -6,10 +6,10 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/BurntSushi/toml"
|
"github.com/BurntSushi/toml"
|
||||||
"github.com/imdario/mergo"
|
|
||||||
units "github.com/docker/go-units"
|
|
||||||
cgv1 "github.com/containerd/cgroups"
|
cgv1 "github.com/containerd/cgroups"
|
||||||
cgv2 "github.com/containerd/cgroups/v2"
|
cgv2 "github.com/containerd/cgroups/v2"
|
||||||
|
units "github.com/docker/go-units"
|
||||||
|
"github.com/imdario/mergo"
|
||||||
)
|
)
|
||||||
|
|
||||||
type providerEnum uint8
|
type providerEnum uint8
|
||||||
|
@ -87,10 +87,12 @@ func (m *mirrorJob) SetProvider(provider mirrorProvider) error {
|
|||||||
|
|
||||||
// runMirrorJob is the goroutine where syncing job runs in
|
// runMirrorJob is the goroutine where syncing job runs in
|
||||||
// arguments:
|
// arguments:
|
||||||
|
//
|
||||||
// provider: mirror provider object
|
// provider: mirror provider object
|
||||||
// ctrlChan: receives messages from the manager
|
// ctrlChan: receives messages from the manager
|
||||||
// managerChan: push messages to the manager, this channel should have a larger buffer
|
// managerChan: push messages to the manager, this channel should have a larger buffer
|
||||||
// sempaphore: make sure the concurrent running syncing job won't explode
|
// sempaphore: make sure the concurrent running syncing job won't explode
|
||||||
|
//
|
||||||
// TODO: message struct for managerChan
|
// TODO: message struct for managerChan
|
||||||
func (m *mirrorJob) Run(managerChan chan<- jobMessage, semaphore chan empty) error {
|
func (m *mirrorJob) Run(managerChan chan<- jobMessage, semaphore chan empty) error {
|
||||||
jobsDone.Add(1)
|
jobsDone.Add(1)
|
||||||
|
@ -11,9 +11,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/codeskyblue/go-sh"
|
"github.com/codeskyblue/go-sh"
|
||||||
"golang.org/x/sys/unix"
|
|
||||||
"github.com/moby/moby/pkg/reexec"
|
|
||||||
cgv1 "github.com/containerd/cgroups"
|
cgv1 "github.com/containerd/cgroups"
|
||||||
|
"github.com/moby/moby/pkg/reexec"
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
// runner is to run os commands giving command line, env and log file
|
// runner is to run os commands giving command line, env and log file
|
||||||
@ -115,7 +115,7 @@ func (c *cmdJob) Start() error {
|
|||||||
if cg != nil {
|
if cg != nil {
|
||||||
logger.Debugf("Preparing cgroup sync pipes for job %s", c.provider.Name())
|
logger.Debugf("Preparing cgroup sync pipes for job %s", c.provider.Name())
|
||||||
var err error
|
var err error
|
||||||
pipeR, pipeW, err = os.Pipe();
|
pipeR, pipeW, err = os.Pipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user