@superhero/eventflow-db 4.2.3 → 4.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/config.js CHANGED
@@ -13,6 +13,7 @@ export default
13
13
  {
14
14
  debug : process.env.EVENTFLOW_MYSQL_DEBUG ?? false,
15
15
  insecureAuth : process.env.EVENTFLOW_MYSQL_INSECURE_AUTH ?? false,
16
+ enableKeepAlive : process.env.EVENTFLOW_MYSQL_ENABLE_KEEP_ALIVE ?? true,
16
17
  connectionLimit : process.env.EVENTFLOW_MYSQL_CONNECTION_LIMIT ?? '5',
17
18
  flags : process.env.EVENTFLOW_MYSQL_FLAGS ?? '',
18
19
  charset : process.env.EVENTFLOW_MYSQL_CHARSET ?? 'UTF8_GENERAL_CI',
package/index.js CHANGED
@@ -680,6 +680,22 @@ export default class DB
680
680
  }
681
681
  }
682
682
 
683
+ async hasHubQuit(hub)
684
+ {
685
+ try
686
+ {
687
+ const result = await this.gateway.query('hub/read-quit-hub', [ hub ])
688
+ return result.length > 0
689
+ }
690
+ catch(reason)
691
+ {
692
+ const error = new Error(`could not check if hub: ${hub} has quit`)
693
+ error.code = 'E_EVENTFLOW_DB_HUB_HAS_QUIT'
694
+ error.cause = reason
695
+ throw error
696
+ }
697
+ }
698
+
683
699
  async persistLog(log)
684
700
  {
685
701
  try
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superhero/eventflow-db",
3
- "version": "4.2.3",
3
+ "version": "4.2.5",
4
4
  "description": "Eventflow db is a set of common database logic in the eventflow ecosystem.",
5
5
  "keywords": [
6
6
  "eventflow"
@@ -15,7 +15,7 @@
15
15
  "@superhero/db": "^0.5.0"
16
16
  },
17
17
  "devDependencies": {
18
- "@superhero/locator": "4.2.4"
18
+ "@superhero/locator": "4.2.5"
19
19
  },
20
20
  "scripts": {
21
21
  "test-build": "docker ps -q -f name=eventflow-mysql | grep -q . && docker stop eventflow-mysql; docker run --rm --name eventflow-mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=eventflow -p 3306:3306 --health-cmd=\"mysqladmin ping -h 127.0.0.1 -uroot -proot --silent || exit 1\" --health-interval=10s --health-timeout=5s --health-retries=5 -d mysql:latest; until [ \"$(docker inspect --format='{{.State.Health.Status}}' eventflow-mysql)\" == \"healthy\" ]; do sleep 1; done",
@@ -0,0 +1,4 @@
1
+ SELECT *
2
+ FROM hub
3
+ WHERE id = ?
4
+ AND quit IS NOT NULL
@@ -1,3 +1,4 @@
1
1
  UPDATE hub
2
2
  SET quit = UTC_TIMESTAMP()
3
- WHERE id = ?
3
+ WHERE id = ?
4
+ AND quit IS NULL