Allow running read-only sqlite queries from libuv worker threads. Needs so much more testing.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4172 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -1562,7 +1562,11 @@ void tf_task_activate(tf_task_t* task)
|
||||
task->_trace = tf_trace_create();
|
||||
if (task->_trusted)
|
||||
{
|
||||
sqlite3_open(*task->_db_path ? task->_db_path : "db.sqlite", &task->_db);
|
||||
if (!*task->_db_path)
|
||||
{
|
||||
snprintf(task->_db_path, sizeof(task->_db_path), "db.sqlite");
|
||||
}
|
||||
sqlite3_open(task->_db_path, &task->_db);
|
||||
|
||||
JS_SetPropertyStr(context, global, "Task", tf_taskstub_register(context));
|
||||
JS_SetPropertyStr(context, global, "Socket", tf_socket_register(context));
|
||||
@ -1570,7 +1574,7 @@ void tf_task_activate(tf_task_t* task)
|
||||
tf_file_register(context);
|
||||
tf_database_register(context, task->_db);
|
||||
|
||||
task->_ssb = tf_ssb_create(&task->_loop, task->_context, task->_db);
|
||||
task->_ssb = tf_ssb_create(&task->_loop, task->_context, task->_db_path);
|
||||
tf_ssb_set_trace(task->_ssb, task->_trace);
|
||||
tf_ssb_register(context, task->_ssb);
|
||||
|
||||
|
Reference in New Issue
Block a user