<commit_before>defmodule Asciinema.FileStore.Cached do
  use Asciinema.FileStore

  @impl true
  def url(path) do
    remote_store().url(path)
  end

  @impl true
  def put_file(dst_path, src_local_path, content_type, compress \\ false) do
    with :ok <- remote_store().put_file(dst_path, src_local_path, content_type, compress),
         :ok <- cache_store().put_file(dst_path, src_local_path, content_type, compress) do
      :ok
    end
  end

  @impl true
  def move_file(from_path, to_path) do
    with :ok <- remote_store().move_file(from_path, to_path),
         :ok <- cache_store().move_file(from_path, to_path) do
      :ok
    end
  end

  @impl true
  def serve_file(conn, path, filename) do
    remote_store().serve_file(conn, path, filename)
  end

  @impl true
  def open_file(path, function \\ nil) do
    case cache_store().open_file(path, function) do
      {:ok, f} ->
        {:ok, f}

      {:error, :enoent} -><commit_msg>Fix move_file/2 for cache miss case<commit_after>defmodule Asciinema.FileStore.Cached do
  use Asciinema.FileStore

  @impl true
  def url(path) do
    remote_store().url(path)
  end

  @impl true
  def put_file(dst_path, src_local_path, content_type, compress \\ false) do
    with :ok <- remote_store().put_file(dst_path, src_local_path, content_type, compress),
         :ok <- cache_store().put_file(dst_path, src_local_path, content_type, compress) do
      :ok
    end
  end

  @impl true
  def move_file(from_path, to_path) do
    with :ok <- remote_store().move_file(from_path, to_path) do
      cache_store().delete_file(from_path)

      :ok
    end
  end

  @impl true
  def serve_file(conn, path, filename) do
    remote_store().serve_file(conn, path, filename)
  end

  @impl true
  def open_file(path, function \\ nil) do
    case cache_store().open_file(path, function) do
      {:ok, f} ->
        {:ok, f}

      {:error, :enoent} ->
{'fraction_non_alphanumeric': 0.11503957783641161, 'fraction_numerical': 0.0005277044854881266, 'mean_word_length': 3.2606741573033706, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 7, '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': '800970', 'n_tokens_mistral': 691, 'n_tokens_neox': 670, 'n_words': 165}