<commit_before>package main

import (
	"errors"
	"fmt"
	"github.com/MG-RAST/Shock/shock-server/conf"
	"github.com/MG-RAST/Shock/shock-server/db"
	"github.com/MG-RAST/Shock/shock-server/node"
	"os"
	"path/filepath"
	"regexp"
	"strings"
)

var (
	dirExp, _ = regexp.Compile("[a-f0-9]{2}/[a-f0-9]{2}/[a-f0-9]{32}$")
)

func reload(source string) (err error) {
	fmt.Println("source:", conf.RELOAD)
	if strings.HasPrefix(conf.RELOAD, "http://") {
		fmt.Println("source-type: url")
		if err = reloadDB(); err != nil {
			return err
		}
		return reloadFromUrl(source)
	} else {
		fmt.Println("source-type: dir")
		if source == conf.Conf["data-path"] {
			fmt.Println("source dir is the same as conf data dir: db reload only.")<commit_msg>fix reload regex for uuidv4<commit_after>package main

import (
	"errors"
	"fmt"
	"github.com/MG-RAST/Shock/shock-server/conf"
	"github.com/MG-RAST/Shock/shock-server/db"
	"github.com/MG-RAST/Shock/shock-server/node"
	"os"
	"path/filepath"
	"regexp"
	"strings"
)

var (
	dirExp, _ = regexp.Compile("(?i)([a-f0-9]{2}/){3}[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$")
)

func reload(source string) (err error) {
	fmt.Println("source:", conf.RELOAD)
	if strings.HasPrefix(conf.RELOAD, "http://") {
		fmt.Println("source-type: url")
		if err = reloadDB(); err != nil {
			return err
		}
		return reloadFromUrl(source)
	} else {
		fmt.Println("source-type: dir")
		if source == conf.Conf["data-path"] {
			fmt.Println("source dir is the same as conf data dir: db reload only.")
{'fraction_non_alphanumeric': 0.20418848167539266, 'fraction_numerical': 0.02225130890052356, 'mean_word_length': 3.932258064516129, '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': '3477693', 'n_tokens_mistral': 688, 'n_tokens_neox': 648, 'n_words': 111}