Content-Length: 446604 | pFad | http://github.com/electric-sql/phoenix_sync/commit/2993f552b5228c1dd41864df049dc97105687e94

12 remove dbg, fix tests, use in-memory kv, bump to version 0.3.1 · electric-sql/phoenix_sync@2993f55 · GitHub
Skip to content

Commit 2993f55

Browse files
committed
remove dbg, fix tests, use in-memory kv, bump to version 0.3.1
1 parent 487ceba commit 2993f55

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

lib/phoenix/sync/application.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule Phoenix.Sync.Application do
77

88
@impl true
99
def start(_type, _args) do
10-
case children() |> dbg do
10+
case children() do
1111
{:ok, children} ->
1212
Supervisor.start_link(children, strategy: :one_for_one, name: Phoenix.Sync.Supervisor)
1313

@@ -106,7 +106,7 @@ defmodule Phoenix.Sync.Application do
106106
def plug_opts(opts) when is_list(opts) do
107107
{adapter, env} = adapter_env(opts)
108108

109-
apply(adapter, :plug_opts, [env, opts]) |> dbg
109+
apply(adapter, :plug_opts, [env, opts])
110110
end
111111

112112
@doc false

lib/phoenix/sync/electric.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ defmodule Phoenix.Sync.Electric do
319319
{Electric.ShapeCache.InMemoryStorage,
320320
table_base_name: :"electric-storage#{opts[:stack_id]}", stack_id: opts[:stack_id]}
321321
)
322+
|> Keyword.put_new(
323+
:persistent_kv,
324+
{Electric.PersistentKV.Memory, :new!, []}
325+
)
322326
|> Keyword.put_new(:send_cache_headers?, false)
323327
end
324328

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule Phoenix.Sync.MixProject do
22
use Mix.Project
33

44
# Remember to update the README when you change the version
5-
@version "0.3.0"
5+
@version "0.3.1"
66

77
def project do
88
[

test/phoenix/sync/application_test.exs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,15 @@ defmodule Phoenix.Sync.ApplicationTest do
6363

6464
validate_repo_connection_opts!(opts)
6565

66+
# assert %{
67+
# storage: {Electric.ShapeCache.FileStorage, [storage_dir: "/tmp/" <> storage_dir]},
68+
# persistent_kv: %Electric.PersistentKV.Filesystem{
69+
# root: "/tmp/" <> storage_dir
70+
# }
71+
# } = Map.new(opts)
6672
assert %{
67-
storage: {Electric.ShapeCache.FileStorage, [storage_dir: "/tmp/" <> storage_dir]},
68-
persistent_kv: %Electric.PersistentKV.Filesystem{
69-
root: "/tmp/" <> storage_dir
70-
}
73+
storage: {Electric.ShapeCache.InMemoryStorage, _},
74+
persistent_kv: %Electric.PersistentKV.Memory{}
7175
} = Map.new(opts)
7276
end
7377

@@ -95,9 +99,14 @@ defmodule Phoenix.Sync.ApplicationTest do
9599
validate_repo_connection_opts!(opts)
96100

97101
assert %{
98-
storage: {Electric.ShapeCache.FileStorage, [storage_dir: "/something"]},
99-
persistent_kv: %Electric.PersistentKV.Filesystem{root: "/something"}
102+
storage: {Electric.ShapeCache.InMemoryStorage, _},
103+
persistent_kv: %Electric.PersistentKV.Memory{}
100104
} = Map.new(opts)
105+
106+
# assert %{
107+
# storage: {Electric.ShapeCache.FileStorage, [storage_dir: "/something"]},
108+
# persistent_kv: %Electric.PersistentKV.Filesystem{root: "/something"}
109+
# } = Map.new(opts)
101110
end
102111

103112
test "embedded mode test env" do
@@ -195,9 +204,13 @@ defmodule Phoenix.Sync.ApplicationTest do
195204

196205
api = App.plug_opts(config)
197206

207+
# assert %Electric.Shapes.Api{
208+
# storage: {Electric.ShapeCache.FileStorage, %{base_path: "/something" <> _}},
209+
# persistent_kv: %Electric.PersistentKV.Filesystem{root: "/something"}
210+
# } = api
198211
assert %Electric.Shapes.Api{
199-
storage: {Electric.ShapeCache.FileStorage, %{base_path: "/something" <> _}},
200-
persistent_kv: %Electric.PersistentKV.Filesystem{root: "/something"}
212+
storage: {Electric.ShapeCache.InMemoryStorage, _},
213+
persistent_kv: %Electric.PersistentKV.Memory{}
201214
} = api
202215
end
203216

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/electric-sql/phoenix_sync/commit/2993f552b5228c1dd41864df049dc97105687e94

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy