<commit_before>package jobs

import (
	"fmt"
	"time"

	"strings"

	"strconv"

	log "github.com/meifamily/logrus"

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

const stopHour = 48 * time.Hour
const checkPushSumDuration = 500 * time.Millisecond
const pauseCheckPushSum = 1 * time.Minute

var psckerCh = make(chan pushSumChecker)
var boardFinish = make(map[string]bool)

type pushSumChecker struct {
	Checker
	account string
}

func NewPushSumChecker() *pushSumChecker {
	return &pushSumChecker{}
}

func (psc pushSumChecker) String() string {
	textMap := map[string]string{
		"pushup":   "推文數",
		"pushdown": "噓文數",
	}
	subType := textMap[psc.subType]
	return fmt.Sprintf("%s@%s\r\n看板：%s；%s：%s%s", psc.word, psc.board, psc.board, subType, psc.word, psc.articles.StringWithPushSum())
}

type BoardArticles struct {
	board    string
	articles article.Articles
}

func (psc pushSumChecker) Run() {
	baCh := make(chan BoardArticles)<commit_msg>change pushsum pause duration<commit_after>package jobs

import (
	"fmt"
	"time"

	"strings"

	"strconv"

	log "github.com/meifamily/logrus"

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

const stopHour = 48 * time.Hour
const checkPushSumDuration = 500 * time.Millisecond
const pauseCheckPushSum = 3 * time.Minute

var psckerCh = make(chan pushSumChecker)
var boardFinish = make(map[string]bool)

type pushSumChecker struct {
	Checker
	account string
}

func NewPushSumChecker() *pushSumChecker {
	return &pushSumChecker{}
}

func (psc pushSumChecker) String() string {
	textMap := map[string]string{
		"pushup":   "推文數",
		"pushdown": "噓文數",
	}
	subType := textMap[psc.subType]
	return fmt.Sprintf("%s@%s\r\n看板：%s；%s：%s%s", psc.word, psc.board, psc.board, subType, psc.word, psc.articles.StringWithPushSum())
}

type BoardArticles struct {
	board    string
	articles article.Articles
}

func (psc pushSumChecker) Run() {
	baCh := make(chan BoardArticles)
{'fraction_non_alphanumeric': 0.13515825491873396, 'fraction_numerical': 0.0051325919589392645, 'mean_word_length': 5.0595854922279795, 'pattern_counts': {'":': 4, '<': 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': '5734362', 'n_tokens_mistral': 933, 'n_tokens_neox': 927, 'n_words': 162}