           meta-size            (.size bos)
           _                    (.close bos)
           start-byte           (+ Long/BYTES meta-size)
-          serializer-id        22  #_(->> (type serializer) (get ser/class->serializer) (get ser/serializer->int))
+          serializer-id        (->> (type serializer) (get ser/class->serializer) (get ser/serializer->int))
           byte-array           (to-byte-array version serializer-id meta-size)]
       (go-try
         (<? (write-edn ac-new key serializer write-handlers 0 meta byte-array))

                                    (.close ac)
                                    (close! res-ch)))))
              (let [file-name (-> path .toString)
                    fn        (-> path .getFileName .toString)
                    env       (update-in env [:msg :keys] file-name)]
                (if (clojure.string/includes? file-name "meta")
                  (into list-keys (map
                                   #(let [old-file-name (-> path .toString)
                                          fn            (-> path .getFileName .toString)
                                          env           (update-in env [:msg :keys] old-file-name)]
                                      (migrate-file-v2 folder fn env buffer-size old-file-name fn serializer read-handlers write-handlers))
                                   (Files/newDirectoryStream (Paths/get file-name (into-array String [])))))
                  (conj list-keys (migrate-file-v1 folder fn env buffer-size file-name fn serializer read-handlers write-handlers))))))
          #{}
          file-paths)
         async/merge
         (async/into #{}))))

(defrecord FileSystemStore [folder serializer read-handlers write-handlers buffer-size detect-old-version locks config]
  PEDNAsyncKeyValueStore
  (-get [this key]
    (io-operation [key] folder config serializer read-handlers write-handlers buffer-size {:operation :read-edn
                                                                                           :format    :data
                                                                                           :version version
                                                                                           :detect-old-files detect-old-version

   :write-handlers empty
   :buffer-size    1 MB
   :config         config} "
  [path & {:keys [serializer compressor encryptor read-handlers write-handlers buffer-size config version detect-old-file-schema?]
           :or   {serializer     (ser/fressian-serializer)
                  read-handlers  (atom {})
                  write-handlers (atom {})
                  buffer-size    (* 1024 1024)
                  config         {:fsync true}}}]
  (let [detect-old-version (when detect-old-file-schema? (atom (detect-old-file-schema path)))
        _                  (check-and-create-folder path)
        store              (map->FileSystemStore {:detect-old-version detect-old-version
                                                  :folder             path
