This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Session Error handling and caching (#26)
- Loading branch information
1 parent
49f1696
commit 2d3605a
Showing
26 changed files
with
353 additions
and
918 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,4 +47,10 @@ | |
/*.sqlite | ||
|
||
## environment vars | ||
.env | ||
.env | ||
|
||
## docker compose file | ||
docker-compose.yml | ||
|
||
## MAC | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
package transform | ||
|
||
import ( | ||
"math" | ||
"pokt_gateway_server/cmd/gateway_server/internal/models" | ||
internal_model "pokt_gateway_server/internal/node_selector_service/models" | ||
) | ||
|
||
func ToPublicQosNode(node *internal_model.QosNode) *models.PublicQosNode { | ||
latency := node.LatencyTracker.GetP90Latency() | ||
if math.IsNaN(latency) { | ||
latency = 0.0 | ||
} | ||
return &models.PublicQosNode{ | ||
ServiceUrl: node.MorseNode.ServiceUrl, | ||
Chain: node.GetChain(), | ||
SessionHeight: node.PocketSession.SessionHeader.SessionHeight, | ||
AppPublicKey: node.AppSigner.PublicKey, | ||
SessionHeight: node.MorseSession.SessionHeader.SessionHeight, | ||
AppPublicKey: node.MorseSigner.PublicKey, | ||
TimeoutReason: string(node.GetTimeoutReason()), | ||
LastKnownErr: node.GetLastKnownErrorStr(), | ||
IsHeathy: node.IsHealthy(), | ||
IsSynced: node.IsSynced(), | ||
LastKnownHeight: node.GetLastKnownHeight(), | ||
TimeoutUntil: node.GetTimeoutUntil(), | ||
P90Latency: latency, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
version: '3' | ||
|
||
services: | ||
gateway-server: | ||
build: . | ||
volumes: | ||
- .env:/app/.env | ||
ports: | ||
- "${HTTP_SERVER_PORT}:${HTTP_SERVER_PORT}" | ||
env_file: | ||
- ./.env | ||
networks: | ||
- bridged_network | ||
# depends_on: | ||
# - postgres | ||
restart: on-failure | ||
logging: | ||
driver: json-file | ||
options: | ||
max-size: 10m | ||
|
||
# this postgres database is only to be used for testing. It should not be used in production systems | ||
# Leverage a production ready postgres database with HA/replicas in prod. | ||
# postgres: | ||
# image: postgres:latest | ||
# environment: | ||
# POSTGRES_DB: postgres | ||
# POSTGRES_USER: myuser | ||
# POSTGRES_PASSWORD: mypassword | ||
# ports: | ||
# - "5433:5432" | ||
# volumes: | ||
# - postgres_data:/var/lib/postgresql/data | ||
# networks: | ||
# - bridged_network | ||
|
||
volumes: | ||
postgres_data: | ||
|
||
networks: | ||
bridged_network: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.