]> git.giacomolli.uk - onechat/blobdiff - schedule.go
Stamp daemon log lines only outside the journal
[onechat] / schedule.go
index d27274bfe416f589b58ff5e0b047e3df129f1246..f3dcfe247d720b08d6d60f9b2ea27fe15c52905f 100644 (file)
@@ -209,6 +209,14 @@ func (s *Schedules) List() string {
        return strings.Join(lines, "\n")
 }
 
+// Len returns the number of schedules.
+func (s *Schedules) Len() int {
+       s.mutex.Lock()
+       defer s.mutex.Unlock()
+
+       return len(s.file.Schedules)
+}
+
 // Remove removes the schedule id and returns the answer of the tool.
 func (s *Schedules) Remove(id int) (string, error) {
        s.mutex.Lock()