|
@@ -3,6 +3,7 @@ package session
|
|
import (
|
|
import (
|
|
"io/ioutil"
|
|
"io/ioutil"
|
|
"os"
|
|
"os"
|
|
|
|
+ "strings"
|
|
"time"
|
|
"time"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -14,7 +15,7 @@ func Clean(tmpdir string) error {
|
|
for _, file := range files {
|
|
for _, file := range files {
|
|
if len(file.Name()) == 40 {
|
|
if len(file.Name()) == 40 {
|
|
if diff := time.Since(file.ModTime()); diff > 24*time.Hour {
|
|
if diff := time.Since(file.ModTime()); diff > 24*time.Hour {
|
|
- err = os.Remove(tmpdir + string(os.PathSeparator) + file.Name())
|
|
|
|
|
|
+ err = os.Remove(strings.Join([]string{tmpdir, file.Name()}, string(os.PathSeparator)))
|
|
if err != nil {
|
|
if err != nil {
|
|
return err
|
|
return err
|
|
}
|
|
}
|