summaryrefslogtreecommitdiff
path: root/system/db/content.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-10-18 23:54:14 -0700
committerSteve Manuel <nilslice@gmail.com>2016-10-18 23:54:14 -0700
commitc74bcc2ec1be59ded3634de1a871c73d9dffba98 (patch)
tree859e76f6d1335133ba8f62da72f068e79331880c /system/db/content.go
parent3414597982c2b4e34d842e9747d1ae58bf8b51b2 (diff)
running SortContent from inside DeleteContent in same goroutine so results are sync
Diffstat (limited to 'system/db/content.go')
-rw-r--r--system/db/content.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/system/db/content.go b/system/db/content.go
index caa2af3..2d6e8ea 100644
--- a/system/db/content.go
+++ b/system/db/content.go
@@ -158,7 +158,11 @@ func DeleteContent(target string) error {
return err
}
- go SortContent(ns)
+ // exception to typical "run in goroutine" pattern:
+ // we want to have an updated admin view as soon as this is deleted, so
+ // in some cases, the delete and redirect is faster than the sort,
+ // thus still showing a deleted post in the admin view.
+ SortContent(ns)
return nil
}