<commit_before>(ns subman.core
  (:gen-class)
  (:require [compojure.handler :as handler]
            [overtone.at-at :as at-at]
            [org.httpkit.server :as server]
            [hiccup.middleware :refer [wrap-base-url]]
            [ring.middleware.reload :refer [wrap-reload]]
            [subman.routes :as routes]
            [subman.filler :as filler]
            [subman.const :as const]
            [subman.models :as models]))

(def app (-> (handler/site routes/main-routes)
             wrap-base-url
             wrap-reload))

(defn init-pool []
  (let [pool (at-at/mk-pool)]
    (at-at/every const/update-period
                 (fn [] filler/update-all
                   models/update-total-count)
                 pool)))

(defn -main [& args]
  (try (models/create-index)
    (catch Exception e (println e)))
  (models/update-total-count)
  (future (init-pool))
  (let [port (Integer/parseInt
              (or (System/getenv "PORT") const/default-port))]
    (server/run-server app {:port port})))<commit_msg>Make update more verbose<commit_after>(ns subman.core
  (:gen-class)
  (:require [compojure.handler :as handler]
            [overtone.at-at :as at-at]
            [org.httpkit.server :as server]
            [hiccup.middleware :refer [wrap-base-url]]
            [ring.middleware.reload :refer [wrap-reload]]
            [subman.routes :as routes]
            [subman.filler :as filler]
            [subman.const :as const]
            [subman.models :as models]))

(def app (-> (handler/site routes/main-routes)
             wrap-base-url
             wrap-reload))

(defn init-pool []
  (let [pool (at-at/mk-pool)]
    (at-at/every const/update-period
                 (fn [] (println "start update")
                   filler/update-all
                   models/update-total-count
                   (println "update finished"))
                 pool)))

(defn -main [& args]
  (try (models/create-index)
    (catch Exception e (println e)))
  (models/update-total-count)
  (future (init-pool))
  (let [port (Integer/parseInt
              (or (System/getenv "PORT") const/default-port))]
    (server/run-server app {:port port})))
{'fraction_non_alphanumeric': 0.14391143911439114, 'fraction_numerical': 0.0, 'mean_word_length': 1.9470108695652173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4297756', 'n_tokens_mistral': 692, 'n_tokens_neox': 683, 'n_words': 152}