<commit_before>package main

import (
	"database/sql"
	"log"
	"time"

	"gopkg.in/resty.v0"
)

type lifeCycle struct {
	shutdown     chan bool
	conn         *sql.DB
	tick         <-chan time.Time
	stmt_unblock *sql.Stmt
	stmt_poke    *sql.Stmt
	stmt_clear   *sql.Stmt
	stmt_delblk  *sql.Stmt
	stmt_delact  *sql.Stmt
}

type PokeMessage struct {
	Uuid string `json:"uuid"`
	// TODO path should be used to tell the client system the basepath
	// where to get it so SOMA + path + item_id === complete_url
	// It is currently hardcoded, should move to the configuration
	// file
	Path string `json:"path"`
}

func (lc *lifeCycle) run() {
	var err error
	lc.tick = time.NewTicker(20 * time.Second).C

	if lc.stmt_unblock, err = lc.conn.Prepare(lcStmtActiveUnblockCondition); err != nil {
		log.Fatal(err)
	}
	defer lc.stmt_unblock.Close()

	if lc.stmt_poke, err = lc.conn.Prepare(lcStmtReadyDeployments); err != nil {
		log.Fatal(err)
	}
	defer lc.stmt_poke.Close()

	if lc.stmt_clear, err = lc.conn.Prepare(lcStmtClearUpdateFlag); err != nil {<commit_msg>LifeCycle: trigger every 5 seconds<commit_after>package main

import (
	"database/sql"
	"log"
	"time"

	"gopkg.in/resty.v0"
)

type lifeCycle struct {
	shutdown     chan bool
	conn         *sql.DB
	tick         <-chan time.Time
	stmt_unblock *sql.Stmt
	stmt_poke    *sql.Stmt
	stmt_clear   *sql.Stmt
	stmt_delblk  *sql.Stmt
	stmt_delact  *sql.Stmt
}

type PokeMessage struct {
	Uuid string `json:"uuid"`
	// TODO path should be used to tell the client system the basepath
	// where to get it so SOMA + path + item_id === complete_url
	// It is currently hardcoded, should move to the configuration
	// file
	Path string `json:"path"`
}

func (lc *lifeCycle) run() {
	var err error
	lc.tick = time.NewTicker(5 * time.Second).C

	if lc.stmt_unblock, err = lc.conn.Prepare(lcStmtActiveUnblockCondition); err != nil {
		log.Fatal(err)
	}
	defer lc.stmt_unblock.Close()

	if lc.stmt_poke, err = lc.conn.Prepare(lcStmtReadyDeployments); err != nil {
		log.Fatal(err)
	}
	defer lc.stmt_poke.Close()

	if lc.stmt_clear, err = lc.conn.Prepare(lcStmtClearUpdateFlag); err != nil {
{'fraction_non_alphanumeric': 0.11650943396226415, 'fraction_numerical': 0.002830188679245283, 'mean_word_length': 3.5031847133757963, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5254493', 'n_tokens_mistral': 826, 'n_tokens_neox': 817, 'n_words': 208}