mirror of
https://github.com/wanderer-industries/wanderer
synced 2026-09-23 05:26:01 +00:00
fix(Map): Fix system revert issues
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
app = 'wanderer'
|
||||
primary_region = 'ams'
|
||||
kill_signal = 'SIGTERM'
|
||||
swap_size_mb = 512
|
||||
|
||||
[build]
|
||||
|
||||
@@ -35,6 +36,6 @@ path = "/metrics"
|
||||
soft_limit = 1000
|
||||
|
||||
[[vm]]
|
||||
memory = '1gb'
|
||||
memory = '256mb'
|
||||
cpu_kind = 'shared'
|
||||
cpus = 1
|
||||
|
||||
@@ -1695,14 +1695,14 @@ defmodule WandererApp.Map.Server.Impl do
|
||||
location.solar_system_id
|
||||
) do
|
||||
{:ok, existing_system} when not is_nil(existing_system) ->
|
||||
updated_system =
|
||||
{:ok, updated_system} =
|
||||
existing_system
|
||||
|> WandererApp.MapSystemRepo.update_position!(%{
|
||||
position_x: position.x,
|
||||
position_y: position.y
|
||||
})
|
||||
|> WandererApp.MapSystemRepo.cleanup_labels!(map_opts)
|
||||
|> WandererApp.MapSystemRepo.cleanup_tags!()
|
||||
|> WandererApp.MapSystemRepo.cleanup_tags()
|
||||
|
||||
@ddrt.insert(
|
||||
{existing_system.solar_system_id,
|
||||
|
||||
@@ -40,14 +40,21 @@ defmodule WandererApp.MapSystemRepo do
|
||||
labels = get_filtered_labels(labels, store_custom_labels?)
|
||||
|
||||
system
|
||||
|> WandererApp.Api.MapSystem.update_labels!(%{
|
||||
|> update_labels!(%{
|
||||
labels: labels
|
||||
})
|
||||
end
|
||||
|
||||
def cleanup_tags(system) do
|
||||
system
|
||||
|> WandererApp.Api.MapSystem.update_tag(%{
|
||||
tag: nil
|
||||
})
|
||||
end
|
||||
|
||||
def cleanup_tags!(system) do
|
||||
system
|
||||
|> WandererApp.Api.MapSystem.update_tag(%{
|
||||
|> WandererApp.Api.MapSystem.update_tag!(%{
|
||||
tag: nil
|
||||
})
|
||||
end
|
||||
@@ -97,6 +104,11 @@ defmodule WandererApp.MapSystemRepo do
|
||||
system
|
||||
|> WandererApp.Api.MapSystem.update_labels(update)
|
||||
|
||||
def update_labels!(system, update),
|
||||
do:
|
||||
system
|
||||
|> WandererApp.Api.MapSystem.update_labels!(update)
|
||||
|
||||
def update_position(system, update),
|
||||
do:
|
||||
system
|
||||
|
||||
Reference in New Issue
Block a user