summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandomChars <random@chars.jp>2021-10-12 17:07:14 +0900
committerRandomChars <random@chars.jp>2021-10-12 17:07:14 +0900
commit40f5a0d9870faf1973e787a35a0f3663571835e7 (patch)
treeaeb2b09e0851c26051d8143b812f605be6958f63
parent61c52917b75dcd9195bb16186015af97c2f5ec7c (diff)
check parent snowflake equals to selfv1.4.1
-rw-r--r--main.go13
-rw-r--r--store/image.go2
2 files changed, 10 insertions, 5 deletions
diff --git a/main.go b/main.go
index 27ab53d..acf82b6 100644
--- a/main.go
+++ b/main.go
@@ -8,10 +8,15 @@ import (
"syscall"
)
-var server = http.Server{}
-var serverConfig map[string]interface{}
-var systemConfig map[string]interface{}
-var executable string
+var (
+ serverConfig map[string]interface{}
+ systemConfig map[string]interface{}
+)
+
+var (
+ server = http.Server{}
+ executable string
+)
var (
r bool
diff --git a/store/image.go b/store/image.go
index 95b5c1d..8daae1c 100644
--- a/store/image.go
+++ b/store/image.go
@@ -315,7 +315,7 @@ func (s *Store) ImageUpdate(hash, source, parent, commentary, commentaryTranslat
info.Source = source
msg += "source"
}
- if parent != "\000" && parent != "" {
+ if parent != "\000" && parent != "" && parent != info.Snowflake {
if p := s.ImageSnowflake(parent); p.Snowflake == parent {
s.getLock(p.Hash).Lock()
defer s.getLock(p.Hash).Unlock()