mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
added mq and database connected funcs and endpoint
This commit is contained in:
@@ -22,6 +22,7 @@ var PG_FUNCTIONS = map[string]interface{}{
|
||||
DELETE_ALL: pgDeleteAllRecords,
|
||||
FETCH_ALL: pgFetchRecords,
|
||||
CLOSE_DB: pgCloseDB,
|
||||
isConnected: pgIsConnected,
|
||||
}
|
||||
|
||||
func getPGConnString() string {
|
||||
@@ -135,3 +136,8 @@ func pgFetchRecords(tableName string) (map[string]string, error) {
|
||||
func pgCloseDB() {
|
||||
PGDB.Close()
|
||||
}
|
||||
|
||||
func pgIsConnected() bool {
|
||||
stats := PGDB.Stats()
|
||||
return stats.OpenConnections > 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user