✏️ 离散化加载时间

This commit is contained in:
fumiama 2021-10-26 13:18:48 +08:00
parent 0f687d6e95
commit 21ff752322
3 changed files with 6 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import (
"crypto/md5"
"errors"
"io"
"math/rand"
"net/http"
"os"
"sync"
@ -34,7 +35,7 @@ var (
func init() {
go func() {
time.Sleep(time.Second)
time.Sleep(time.Second + time.Millisecond*time.Duration(rand.Intn(1000)))
err := os.MkdirAll(datapath, 0755)
if err != nil {
panic(err)

View File

@ -4,6 +4,7 @@ package timer
import (
"fmt"
"io"
"math/rand"
"os"
"strconv"
"strings"
@ -41,7 +42,7 @@ var (
func init() {
go func() {
time.Sleep(time.Second)
time.Sleep(time.Second + time.Millisecond*time.Duration(rand.Intn(1000)))
err := os.MkdirAll(datapath, 0755)
if err != nil {
panic(err)

View File

@ -3,6 +3,7 @@ package reborn
import (
"encoding/json"
"io"
"math/rand"
"net/http"
"os"
"time"
@ -30,7 +31,7 @@ var (
func init() {
go func() {
time.Sleep(time.Second)
time.Sleep(time.Second + time.Millisecond*time.Duration(rand.Intn(1000)))
err := os.MkdirAll(datapath, 0755)
if err != nil {
panic(err)