From c74bcc2ec1be59ded3634de1a871c73d9dffba98 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Tue, 18 Oct 2016 23:54:14 -0700 Subject: running SortContent from inside DeleteContent in same goroutine so results are sync --- system/db/content.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'system/db/content.go') 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 } -- cgit v1.2.3