<commit_before>package main

import (
	"fmt"
	"time"

	"github.com/carlescere/scheduler"
)

func main() {
	fmt.Println("Main execute at:\t", time.Now())

	scheduler.Every(5).Seconds().Run(func() {
		fmt.Println("Execute every 5 seconds\t", time.Now())
	})

	scheduler.Every(1).Minutes().Run(func() {
		fmt.Println("Execute every 1 minute\t", time.Now())
	})

	scheduler.Every().Day().Run(func() {
		fmt.Println("Execute every 1 day\t", time.Now())
	})

	scheduler.Every().Sunday().At("08:30").Run(func() {
		fmt.Println("Execute every Sunday 08:30\t", time.Now())
	})

	done := make(chan struct{})

	<-done
}<commit_msg>Update observer main func<commit_after>package main

import (
	"github.com/gin-gonic/gin"
	"github.com/miclle/observer/detector"
	"qiniupkg.com/x/log.v7"
)

func main() {
	router := gin.Default()

	host := "127.0.0.1:27017"
	name := "observer_test"
	mode := "strong"

	detector.Init(host, name, mode)

	// Monitor
	router.GET("/tasks", func(c *gin.Context) {
		tasks, err := detector.TaskMgr.List()

		if err != nil {
			log.Error(err.Error())
			c.JSON(400, err)
			c.Abort()
			return
		}
		c.JSON(200, gin.H{"tasks": tasks})
	})

	router.Run(":8000")
}
{'fraction_non_alphanumeric': 0.2076595744680851, 'fraction_numerical': 0.029787234042553193, 'mean_word_length': 3.879668049792531, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4684685', 'n_tokens_mistral': 516, 'n_tokens_neox': 460, 'n_words': 81}