<commit_before>package jobs

import (
	"fmt"
	"time"
)

// WorkersList is a map associating a worker type with its acutal
// configuration.
type WorkersList map[string]*WorkerConfig

// WorkersList is the list of available workers with their associated Do
// function.
var workersList WorkersList

func init() {
	workersList = WorkersList{
		"print": {
			Concurrency: 4,
			WorkerFunc: func(m *Message, _ <-chan time.Time) error {
				var msg string
				if err := m.Unmarshal(&msg); err != nil {
					return err
				}
				_, err := fmt.Println(msg)
				return err
			},
		},
		"timeout": {
			Concurrency: 4,
			Timeout:     1 * time.Second,
			WorkerFunc: func(_ *Message, timeout <-chan time.Time) error {
				<-timeout
				return ErrTimedOut
			},
		},
	}
}

// GetWorkersList returns a globally defined worker config list
func GetWorkersList() WorkersList {
	return workersList
}<commit_msg>Increase timeout for timeout job<commit_after>package jobs

import (
	"fmt"
	"time"
)

// WorkersList is a map associating a worker type with its acutal
// configuration.
type WorkersList map[string]*WorkerConfig

// WorkersList is the list of available workers with their associated Do
// function.
var workersList WorkersList

func init() {
	workersList = WorkersList{
		"print": {
			Concurrency: 4,
			WorkerFunc: func(m *Message, _ <-chan time.Time) error {
				var msg string
				if err := m.Unmarshal(&msg); err != nil {
					return err
				}
				_, err := fmt.Println(msg)
				return err
			},
		},
		"timeout": {
			Concurrency: 4,
			Timeout:     10 * time.Second,
			WorkerFunc: func(_ *Message, timeout <-chan time.Time) error {
				<-timeout
				return ErrTimedOut
			},
		},
	}
}

// GetWorkersList returns a globally defined worker config list
func GetWorkersList() WorkersList {
	return workersList
}
{'fraction_non_alphanumeric': 0.10596026490066225, 'fraction_numerical': 0.003863134657836645, 'mean_word_length': 3.167816091954023, 'pattern_counts': {'":': 4, '<': 9, '<?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': '779677', 'n_tokens_mistral': 670, 'n_tokens_neox': 554, 'n_words': 186}