aboutsummaryrefslogtreecommitdiffstats
path: root/lib/apiv1/folders.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-08-18 01:04:02 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-08-18 01:04:02 +0200
commit8f44cc7217ce48f3f94c8ea3f037cdf011c4493b (patch)
treea93c483370e6ad64a7440241cfb7c21beb6021ba /lib/apiv1/folders.go
parent4feef5296bf3aea331fdde4cd7b94ee2322a907e (diff)
Add folder synchronization status.
Also add ability to force re-synchronization.
Diffstat (limited to 'lib/apiv1/folders.go')
-rw-r--r--lib/apiv1/folders.go16
1 files changed, 15 insertions, 1 deletions
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)
-
}