aboutsummaryrefslogtreecommitdiff
path: root/app/util.go
diff options
context:
space:
mode:
authorlost+skunk <[email protected]>2024-07-13 23:55:28 +0300
committerlost+skunk <[email protected]>2024-07-13 23:55:28 +0300
commite02174cb710e6d6abd642f03e64ce91bbac38130 (patch)
tree691795941b1fda1e37df100b7b70c2134350e274 /app/util.go
parent4b3bf2c6a063f5702cb35626b595d11bd6630068 (diff)
downloadskunky-art-1.3.tar.gz
skunky-art-1.3.tar.bz2
skunky-art-1.3.zip
Исправление некоторых обосрамсовv1.3
Diffstat (limited to 'app/util.go')
-rw-r--r--app/util.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/util.go b/app/util.go
index 7006760..3f69e47 100644
--- a/app/util.go
+++ b/app/util.go
@@ -112,7 +112,6 @@ func (s skunkyart) DownloadAndSendMedia(subdomain, path string) {
url.WriteString(s.Args.Get("token"))
if CFG.Cache.Enabled {
- os.Mkdir(CFG.Cache.Path, 0700)
fname := CFG.Cache.Path + "/" + base64.StdEncoding.EncodeToString([]byte(subdomain+path))
file, e := os.Open(fname)
@@ -138,6 +137,7 @@ func (s skunkyart) DownloadAndSendMedia(subdomain, path string) {
func InitCacheSystem() {
c := &CFG.Cache
+ os.Mkdir(CFG.Cache.Path, 0700)
for {
dir, e := os.Open(c.Path)
try(e)
@@ -175,10 +175,9 @@ func CopyTemplatesToMemory() {
try_with_exitstatus(e, 1)
for _, x := range dir {
- n := dirname + "/" + x.Name()
- file, e := os.ReadFile(n)
+ file, e := os.ReadFile(dirname + "/" + x.Name())
try_with_exitstatus(e, 1)
- Templates[n] = string(file)
+ Templates[x.Name()] = string(file)
}
}
}