mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-08 14:58:26 +00:00
build, cmd, lib: Minimum supported compiler version is Go 1.5
This commit is contained in:
parent
42849af5a8
commit
cf5febad47
2
build.go
2
build.go
@ -168,7 +168,7 @@ func init() {
|
|||||||
targets["syncthing"] = syncthingPkg
|
targets["syncthing"] = syncthingPkg
|
||||||
}
|
}
|
||||||
|
|
||||||
const minGoVersion = 1.3
|
const minGoVersion = 1.5
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
log.SetOutput(os.Stdout)
|
log.SetOutput(os.Stdout)
|
||||||
|
@ -66,7 +66,7 @@ func checkServers(deviceID protocol.DeviceID, servers ...string) {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
for _ = range servers {
|
for range servers {
|
||||||
res := <-resc
|
res := <-resc
|
||||||
|
|
||||||
u, _ := url.Parse(res.server)
|
u, _ := url.Parse(res.server)
|
||||||
|
@ -212,7 +212,7 @@ func main() {
|
|||||||
|
|
||||||
func monitorLimits() {
|
func monitorLimits() {
|
||||||
limitCheckTimer = time.NewTimer(time.Minute)
|
limitCheckTimer = time.NewTimer(time.Minute)
|
||||||
for _ = range limitCheckTimer.C {
|
for range limitCheckTimer.C {
|
||||||
if atomic.LoadInt64(&numConnections)+atomic.LoadInt64(&numProxies) > descriptorLimit {
|
if atomic.LoadInt64(&numConnections)+atomic.LoadInt64(&numProxies) > descriptorLimit {
|
||||||
atomic.StoreInt32(&overLimit, 1)
|
atomic.StoreInt32(&overLimit, 1)
|
||||||
log.Println("Gone past our connection limits. Starting to refuse new/drop idle connections.")
|
log.Println("Gone past our connection limits. Starting to refuse new/drop idle connections.")
|
||||||
|
@ -130,7 +130,7 @@ func printProgress(prefix string, count *int64) {
|
|||||||
expectedIterations := float64(int(1) << uint(wantBits))
|
expectedIterations := float64(int(1) << uint(wantBits))
|
||||||
fmt.Printf("Want %d bits for prefix %q, about %.2g certs to test (statistically speaking)\n", wantBits, prefix, expectedIterations)
|
fmt.Printf("Want %d bits for prefix %q, about %.2g certs to test (statistically speaking)\n", wantBits, prefix, expectedIterations)
|
||||||
|
|
||||||
for _ = range time.NewTicker(15 * time.Second).C {
|
for range time.NewTicker(15 * time.Second).C {
|
||||||
tried := atomic.LoadInt64(count)
|
tried := atomic.LoadInt64(count)
|
||||||
elapsed := time.Since(started)
|
elapsed := time.Since(started)
|
||||||
rate := float64(tried) / elapsed.Seconds()
|
rate := float64(tried) / elapsed.Seconds()
|
||||||
|
@ -78,7 +78,7 @@ func trackCPUUsage() {
|
|||||||
var prevTime = time.Now().UnixNano()
|
var prevTime = time.Now().UnixNano()
|
||||||
var rusage prusage_t
|
var rusage prusage_t
|
||||||
var pid = os.Getpid()
|
var pid = os.Getpid()
|
||||||
for _ = range time.NewTicker(time.Second).C {
|
for range time.NewTicker(time.Second).C {
|
||||||
err := solarisPrusage(pid, &rusage)
|
err := solarisPrusage(pid, &rusage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Warnln("getting prusage:", err)
|
l.Warnln("getting prusage:", err)
|
||||||
|
@ -21,7 +21,7 @@ func trackCPUUsage() {
|
|||||||
var prevUsage int64
|
var prevUsage int64
|
||||||
var prevTime = time.Now().UnixNano()
|
var prevTime = time.Now().UnixNano()
|
||||||
var rusage syscall.Rusage
|
var rusage syscall.Rusage
|
||||||
for _ = range time.NewTicker(time.Second).C {
|
for range time.NewTicker(time.Second).C {
|
||||||
syscall.Getrusage(syscall.RUSAGE_SELF, &rusage)
|
syscall.Getrusage(syscall.RUSAGE_SELF, &rusage)
|
||||||
curTime := time.Now().UnixNano()
|
curTime := time.Now().UnixNano()
|
||||||
timeDiff := curTime - prevTime
|
timeDiff := curTime - prevTime
|
||||||
|
@ -34,7 +34,7 @@ func trackCPUUsage() {
|
|||||||
prevTime := ctime.Nanoseconds()
|
prevTime := ctime.Nanoseconds()
|
||||||
prevUsage := ktime.Nanoseconds() + utime.Nanoseconds() // Always overflows
|
prevUsage := ktime.Nanoseconds() + utime.Nanoseconds() // Always overflows
|
||||||
|
|
||||||
for _ = range time.NewTicker(time.Second).C {
|
for range time.NewTicker(time.Second).C {
|
||||||
err := syscall.GetProcessTimes(handle, &ctime, &etime, &ktime, &utime)
|
err := syscall.GetProcessTimes(handle, &ctime, &etime, &ktime, &utime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
|
@ -273,7 +273,7 @@ func BenchmarkJobQueuePushPopDone10k(b *testing.B) {
|
|||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
q.Push(f.Name, 0, time.Time{})
|
q.Push(f.Name, 0, time.Time{})
|
||||||
}
|
}
|
||||||
for _ = range files {
|
for range files {
|
||||||
n, _ := q.Pop()
|
n, _ := q.Pop()
|
||||||
q.Done(n)
|
q.Done(n)
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ func TestCompare(t *testing.T) {
|
|||||||
// Empty vectors are identical
|
// Empty vectors are identical
|
||||||
{Vector{}, Vector{}, Equal},
|
{Vector{}, Vector{}, Equal},
|
||||||
{Vector{}, Vector{[]Counter{{42, 0}}}, Equal},
|
{Vector{}, Vector{[]Counter{{42, 0}}}, Equal},
|
||||||
{Vector{[]Counter{Counter{42, 0}}}, Vector{}, Equal},
|
{Vector{[]Counter{{42, 0}}}, Vector{}, Equal},
|
||||||
|
|
||||||
// Zero is the implied value for a missing Counter
|
// Zero is the implied value for a missing Counter
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,7 @@ func NewStaggered(folderID, folderPath string, params map[string]string) Version
|
|||||||
if testCleanDone != nil {
|
if testCleanDone != nil {
|
||||||
close(testCleanDone)
|
close(testCleanDone)
|
||||||
}
|
}
|
||||||
for _ = range time.Tick(time.Duration(cleanInterval) * time.Second) {
|
for range time.Tick(time.Duration(cleanInterval) * time.Second) {
|
||||||
s.clean()
|
s.clean()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user