diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-07-04 21:41:41 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-07-04 21:43:29 +0200 |
commit | 254ece5752ae84019028f98615a14a9f26cc16c6 (patch) | |
tree | 9798480eacfbaf06e649ce6f2cc1df739af5b1bb /src | |
parent | sqlite: rename a column (diff) | |
download | cimple-254ece5752ae84019028f98615a14a9f26cc16c6.tar.gz cimple-254ece5752ae84019028f98615a14a9f26cc16c6.zip |
storage_sqlite: refactoring
Diffstat (limited to 'src')
-rw-r--r-- | src/server.c | 5 | ||||
-rw-r--r-- | src/storage_sqlite.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/server.c b/src/server.c index f00385f..a1bbbe8 100644 --- a/src/server.c +++ b/src/server.c @@ -380,11 +380,9 @@ int server_create(struct server **_server, const struct settings *settings) if (ret < 0) goto destroy_worker_queue; - run_queue_create(&server->run_queue); - ret = storage_get_run_queue(&server->storage, &server->run_queue); if (ret < 0) - goto destroy_run_queue; + goto destroy_storage; ret = tcp_server_create(&server->tcp_server, settings->port, cmd_dispatcher_handle_conn, server->cmd_dispatcher); @@ -410,6 +408,7 @@ destroy_tcp_server: destroy_run_queue: run_queue_destroy(&server->run_queue); +destroy_storage: storage_destroy(&server->storage); destroy_worker_queue: diff --git a/src/storage_sqlite.c b/src/storage_sqlite.c index eee26fe..e0f0eac 100644 --- a/src/storage_sqlite.c +++ b/src/storage_sqlite.c @@ -403,6 +403,8 @@ int storage_sqlite_get_run_queue(struct storage *storage, struct run_queue *queu if (ret < 0) return ret; + run_queue_create(queue); + while (1) { ret = sqlite_step(stmt); if (!ret) |