From 8f44cc7217ce48f3f94c8ea3f037cdf011c4493b Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Fri, 18 Aug 2017 01:04:02 +0200 Subject: Add folder synchronization status. Also add ability to force re-synchronization. --- lib/apiv1/folders.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lib/apiv1/folders.go') diff --git a/lib/apiv1/folders.go b/lib/apiv1/folders.go index f957c6d..cf56c3f 100644 --- a/lib/apiv1/folders.go +++ b/lib/apiv1/folders.go @@ -43,6 +43,21 @@ func (s *APIService) addFolder(c *gin.Context) { c.JSON(http.StatusOK, newFld) } +// syncFolder force synchronization of folder files +func (s *APIService) syncFolder(c *gin.Context) { + id := c.Param("id") + + s.log.Debugln("Sync folder id: ", id) + + err := s.mfolders.ForceSync(id) + if err != nil { + common.APIError(c, err.Error()) + return + } + + c.JSON(http.StatusOK, "") +} + // delFolder deletes folder from server config func (s *APIService) delFolder(c *gin.Context) { id := c.Param("id") @@ -55,5 +70,4 @@ func (s *APIService) delFolder(c *gin.Context) { return } c.JSON(http.StatusOK, delEntry) - } -- cgit 1.2.3-korg