<commit_before>package main

import (
	"flag"
	"fmt"
	"github.com/APTrust/exchange/context"
	"github.com/APTrust/exchange/models"
	"github.com/APTrust/exchange/workers"
	"os"
	"time"
)

// 20 GB
const MAX_FILE_SIZE = int64(21474836480)
const DAYS_SINCE_INGEST = 180
const DAYS_SINCE_LAST_RESTORE = 180

func main() {
	pathToConfigFile, dryRun := parseCommandLine()
	config, err := models.LoadConfigFile(pathToConfigFile)
	if err != nil {
		fmt.Fprintf(os.Stderr, err.Error())
		os.Exit(1)
	}
	createdBefore := time.Now().UTC().AddDate(0, 0, DAYS_SINCE_INGEST)
	notRestoredSince := time.Now().UTC().AddDate(0, 0, DAYS_SINCE_LAST_RESTORE)
	_context := context.NewContext(config)
	worker := workers.NewAPTSpotTestRestore(_context, MAX_FILE_SIZE, createdBefore, notRestoredSince)
	worker.DryRun = dryRun
	items, err := worker.Run()
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error: ", err.Error())
	} else {
		printResults(items)<commit_msg>Fixed https://trello.com/c/dMoQJnnT. Choose items that have not been restored in PAST 180 days.<commit_after>package main

import (
	"flag"
	"fmt"
	"github.com/APTrust/exchange/context"
	"github.com/APTrust/exchange/models"
	"github.com/APTrust/exchange/workers"
	"os"
	"time"
)

// 53687091200 = 50 GB
const MAX_FILE_SIZE = int64(53687091200)
const DAYS_SINCE_INGEST = 180
const DAYS_SINCE_LAST_RESTORE = 180

func main() {
	pathToConfigFile, dryRun := parseCommandLine()
	config, err := models.LoadConfigFile(pathToConfigFile)
	if err != nil {
		fmt.Fprintf(os.Stderr, err.Error())
		os.Exit(1)
	}
	createdBefore := time.Now().UTC().AddDate(0, 0, (-1 * DAYS_SINCE_INGEST))
	notRestoredSince := time.Now().UTC().AddDate(0, 0, (-1 * DAYS_SINCE_LAST_RESTORE))
	_context := context.NewContext(config)
	worker := workers.NewAPTSpotTestRestore(_context, MAX_FILE_SIZE, createdBefore, notRestoredSince)
	worker.DryRun = dryRun
	items, err := worker.Run()
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error: ", err.Error())
	} else {
		printResults(items)
{'fraction_non_alphanumeric': 0.14249748237663645, 'fraction_numerical': 0.03423967774420947, 'mean_word_length': 5.170807453416149, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '2007609', 'n_tokens_mistral': 840, 'n_tokens_neox': 756, 'n_words': 140}