<commit_before>package main

import (
	"fmt"
	"socialapi/workers/common/runner"
	"socialapi/workers/helper"
	"socialapi/workers/popularpost/popularpost"
)

var (
	Name = "PopularPost"
)

func main() {
	r := runner.New(Name)
	if err := r.Init(); err != nil {
		fmt.Println(err)
		return
	}

	// create message handler
	handler := popularpost.New(
		r.Log,
		helper.MustInitRedisConn(r.Conf),
	)

	r.SetContext(handler)
	r.ListenFor("api.interaction_created", (*popularpost.Controller).InteractionSaved)
	r.ListenFor("api.interaction_deleted", (*popularpost.Controller).InteractionDeleted)
	r.Listen()
	r.Wait()
}<commit_msg>Social: ListerFor to Register<commit_after>package main

import (
	"fmt"
	"socialapi/models"
	"socialapi/workers/common/runner"
	"socialapi/workers/helper"
	"socialapi/workers/popularpost/popularpost"
)

var (
	Name = "PopularPost"
)

func main() {
	r := runner.New(Name)
	if err := r.Init(); err != nil {
		fmt.Println(err)
		return
	}

	// create context
	context := popularpost.New(r.Log, helper.MustInitRedisConn(r.Conf))

	r.SetContext(context)
	r.Register(models.Interaction{}).OnCreate().Handle((*popularpost.Controller).InteractionSaved)
	r.Register(models.Interaction{}).OnDelete().Handle((*popularpost.Controller).InteractionDeleted)
	r.Listen()
	r.Wait()
}
{'fraction_non_alphanumeric': 0.1573643410852713, 'fraction_numerical': 0.0, 'mean_word_length': 5.061032863849765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1551357', 'n_tokens_mistral': 484, 'n_tokens_neox': 466, 'n_words': 70}