<commit_before>package jobs

import (
	"context"
	"fmt"
	"sync"
	"time"

	"strings"

	"strconv"

	log "github.com/meifamily/logrus"

	"github.com/meifamily/ptt-alertor/crawler"
	"github.com/meifamily/ptt-alertor/models"
	"github.com/meifamily/ptt-alertor/models/article"
	"github.com/meifamily/ptt-alertor/models/pushsum"
	"github.com/meifamily/ptt-alertor/models/subscription"
	"github.com/meifamily/ptt-alertor/models/user"
)

// change overdueHour must change cronjob replacepushsumkey in the mean time
const overdueHour = 48 * time.Hour
const pauseCheckPushSum = 1 * time.Minute

var psCker *pushSumChecker
var pscOnce sync.Once

type pushSumChecker struct {
	Checker
	ch chan pushSumChecker
}

func NewPushSumChecker() *pushSumChecker {
	pscOnce.Do(func() {
		psCker = &pushSumChecker{}
		psCker.done = make(chan struct{})<commit_msg>:zap: increase pushsum checker interval to decrease CPU usage<commit_after>package jobs

import (
	"context"
	"fmt"
	"sync"
	"time"

	"strings"

	"strconv"

	log "github.com/meifamily/logrus"

	"github.com/meifamily/ptt-alertor/crawler"
	"github.com/meifamily/ptt-alertor/models"
	"github.com/meifamily/ptt-alertor/models/article"
	"github.com/meifamily/ptt-alertor/models/pushsum"
	"github.com/meifamily/ptt-alertor/models/subscription"
	"github.com/meifamily/ptt-alertor/models/user"
)

// change overdueHour must change cronjob replacepushsumkey in the mean time
const overdueHour = 48 * time.Hour
const pauseCheckPushSum = 5 * time.Minute

var psCker *pushSumChecker
var pscOnce sync.Once

type pushSumChecker struct {
	Checker
	ch chan pushSumChecker
}

func NewPushSumChecker() *pushSumChecker {
	pscOnce.Do(func() {
		psCker = &pushSumChecker{}
		psCker.done = make(chan struct{})
{'fraction_non_alphanumeric': 0.11587485515643106, 'fraction_numerical': 0.0034762456546929316, 'mean_word_length': 4.8941979522184305, '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': '3673118', 'n_tokens_mistral': 673, 'n_tokens_neox': 670, 'n_words': 121}