Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust query to return transactions #7

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/backend_fight/lib/backend_fight/customers.ex
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ defmodule BackendFight.Customers do
def find_for_customer_information(customer_id) when is_integer(customer_id) do
transaction_query =
from(transaction in Transaction,
order_by: [desc: transaction.inserted_at],
order_by: [desc: transaction.inserted_at, desc: transaction.id],
limit: @number_of_serialized_transactions
)

4 changes: 1 addition & 3 deletions config/prod.exs
Original file line number Diff line number Diff line change
@@ -5,9 +5,7 @@ import Config
# manifest is generated by the `mix phx.digest` task,
# which you should run after static files are built and
# before starting your production server.
config :backend_fight_web, BackendFightWeb.Endpoint,
url: [host: "example.com", port: 80],
cache_static_manifest: "priv/static/cache_manifest.json"
config :backend_fight_web, BackendFightWeb.Endpoint, url: [host: "example.com", port: 80]

# Configures Swoosh API Client
config :swoosh, :api_client, BackendFight.Finch
2 changes: 2 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ services:
context: .
dockerfile: Dockerfile
target: release
container_name: api1
environment: &api_env
MIX_ENV: prod
PHX_SERVER: true
@@ -51,6 +52,7 @@ services:

api2:
<<: *api
container_name: api2
environment:
<<: *api_env
RELEASE_NODE: api2@127.0.0.1
5 changes: 5 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh

until nc -z -v -w20 database 5432; do
>&2 echo "PostgreSql is unavailable - sleeping"
sleep 2;
done

if [ "$1" = 'release' ]; then
exec /app/bin/backend_fight start
elif [ "$1" = 'migrate_and_release' ]; then
Loading
Oops, something went wrong.