<commit_before>package marketTypes

import (
	"net/http"
	"time"

	"github.com/Sirupsen/logrus"
	"github.com/antihax/goesi"
)

var esiClient goesi.APIClient
var esiSemaphore = make(chan struct{}, 500)
var typeIDs []int64

// Initialize initializes the market type updates
func Initialize() {
	httpClient := &http.Client{
		Timeout: time.Duration(time.Second * 10),
	}
	esiClient = *goesi.NewAPIClient(httpClient, "Element43/market-streamer (element-43.com)")

	updateTypes()
	go scheduleTypeUpdate()
}

// GetMarketTypes returns all typeIDs with a market
func GetMarketTypes() []int64 {
	return typeIDs
}

// Keep ticking in own goroutine and spawn worker tasks.
func scheduleTypeUpdate() {
	ticker := time.NewTicker(30 * time.Minute)
	defer ticker.Stop()
	for {
		<-ticker.C
		go updateTypes()
	}
}<commit_msg>Fetch types every 6 hours instead of 30 minutes<commit_after>package marketTypes

import (
	"net/http"
	"time"

	"github.com/Sirupsen/logrus"
	"github.com/antihax/goesi"
)

var esiClient goesi.APIClient
var esiSemaphore = make(chan struct{}, 500)
var typeIDs []int64

// Initialize initializes the market type updates
func Initialize() {
	httpClient := &http.Client{
		Timeout: time.Duration(time.Second * 10),
	}
	esiClient = *goesi.NewAPIClient(httpClient, "Element43/market-streamer (element-43.com)")

	updateTypes()
	go scheduleTypeUpdate()
}

// GetMarketTypes returns all typeIDs with a market
func GetMarketTypes() []int64 {
	return typeIDs
}

// Keep ticking in own goroutine and spawn worker tasks.
func scheduleTypeUpdate() {
	ticker := time.NewTicker(6 * time.Hour)
	defer ticker.Stop()
	for {
		<-ticker.C
		go updateTypes()
	}
}
{'fraction_non_alphanumeric': 0.11857229280096794, 'fraction_numerical': 0.019358741681790685, 'mean_word_length': 4.569023569023569, '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': '1982189', 'n_tokens_mistral': 605, 'n_tokens_neox': 573, 'n_words': 148}