Skip to content

Commit

Permalink
fix: 应该调用filepath.Ext的地方调用了path.Ext (#1696)
Browse files Browse the repository at this point in the history
* fix: 应该调用filepath.Ext的地方调用了path.Ext

* fix: typo
  • Loading branch information
ShuBo6 authored Apr 3, 2024
1 parent c226a94 commit 53e9f93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions server/utils/timer/timed_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,19 @@ func (t *timer) FindCronList() map[string]*taskManager {
}

// StartCron 开始任务
func (t *timer) StartCron(cromName string) {
func (t *timer) StartCron(cronName string) {
t.Lock()
defer t.Unlock()
if v, ok := t.cronList[cromName]; ok {
if v, ok := t.cronList[cronName]; ok {
v.corn.Start()
}
}

// StopCron 停止任务
func (t *timer) StopCron(cromName string) {
func (t *timer) StopCron(cronName string) {
t.Lock()
defer t.Unlock()
if v, ok := t.cronList[cromName]; ok {
if v, ok := t.cronList[cronName]; ok {
v.corn.Stop()
}
}
Expand Down
4 changes: 2 additions & 2 deletions server/utils/upload/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"mime/multipart"
"os"
"path"
"path/filepath"
"strings"
"time"

Expand All @@ -27,7 +27,7 @@ type Local struct{}

func (*Local) UploadFile(file *multipart.FileHeader) (string, string, error) {
// 读取文件后缀
ext := path.Ext(file.Filename)
ext := filepath.Ext(file.Filename)
// 读取文件名并加密
name := strings.TrimSuffix(file.Filename, ext)
name = utils.MD5V([]byte(name))
Expand Down

0 comments on commit 53e9f93

Please sign in to comment.