diff options
-rw-r--r-- | system/db/content.go | 4 | ||||
-rw-r--r-- | system/db/init.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/system/db/content.go b/system/db/content.go index 35f690f..542d539 100644 --- a/system/db/content.go +++ b/system/db/content.go @@ -208,8 +208,6 @@ func ContentAll(namespace string) [][]byte { func SortContent(namespace string) { all := ContentAll(namespace) - fmt.Println(all) - var posts sortablePosts // decode each (json) into Editable for i := range all { @@ -245,7 +243,7 @@ func SortContent(namespace string) { return err } - // encode to json and store as i-post.Time():post + // encode to json and store as 'i:post.Time()':post for i := range posts { j, err := json.Marshal(posts[i]) if err != nil { diff --git a/system/db/init.go b/system/db/init.go index 58bb773..d035510 100644 --- a/system/db/init.go +++ b/system/db/init.go @@ -33,6 +33,8 @@ func Init() { if err != nil { return err } + + go SortContent(t + "_sorted") } // init db with other buckets as needed |