Refactor state database (#22)

* make db_connect return the connection

* rename db_conn -> db_handle

* more renaming

* clang-format

* free the db_handle
This commit is contained in:
Philipp Moritz
2016-09-25 21:52:06 -07:00
committed by Robert Nishihara
parent 1e08629013
commit db8c0acc71
9 changed files with 67 additions and 69 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ struct ray_logger_impl {
int log_level;
/* Whether or not we have a direct connection to Redis. */
int is_direct;
/* Either a db_conn or a socket to a process with a db_conn,
/* Either a db_handle or a socket to a process with a db_handle,
* depending on the is_direct flag. */
void *conn;
};
@@ -57,7 +57,7 @@ void ray_log(ray_logger *logger,
UT_string *origin_id;
utstring_new(origin_id);
if (logger->is_direct) {
db_conn *db = (db_conn *) logger->conn;
db_handle *db = (db_handle *) logger->conn;
utstring_printf(origin_id, "%ld:%s", db->client_id, "");
redisAsyncCommand(db->context, NULL, NULL, log_fmt,
utstring_body(timestamp), logger->client_type,