forked from cory/tildefriends
Make import and export commands complete reliably.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4621 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
52aa6eed0d
commit
699438602c
@ -307,6 +307,7 @@ static int _tf_run_task(const tf_run_args_t* args, int index)
|
|||||||
}
|
}
|
||||||
tf_task_set_db_path(task, db_path);
|
tf_task_set_db_path(task, db_path);
|
||||||
tf_task_activate(task);
|
tf_task_activate(task);
|
||||||
|
tf_ssb_start_periodic(tf_task_get_ssb(task));
|
||||||
if (args->zip)
|
if (args->zip)
|
||||||
{
|
{
|
||||||
tf_ssb_import_from_zip(tf_task_get_ssb(task), args->zip, "core", "apps");
|
tf_ssb_import_from_zip(tf_task_get_ssb(task), args->zip, "core", "apps");
|
||||||
|
@ -2168,6 +2168,11 @@ tf_ssb_t* tf_ssb_create(uv_loop_t* loop, JSContext* context, const char* db_path
|
|||||||
return ssb;
|
return ssb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tf_ssb_start_periodic(tf_ssb_t* ssb)
|
||||||
|
{
|
||||||
|
tf_ssb_rpc_start_periodic(ssb);
|
||||||
|
}
|
||||||
|
|
||||||
static void _tf_ssb_assert_not_main_thread(tf_ssb_t* ssb)
|
static void _tf_ssb_assert_not_main_thread(tf_ssb_t* ssb)
|
||||||
{
|
{
|
||||||
if (uv_thread_self() == ssb->thread_self)
|
if (uv_thread_self() == ssb->thread_self)
|
||||||
|
@ -81,6 +81,8 @@ typedef struct _tf_ssb_store_queue_t
|
|||||||
tf_ssb_t* tf_ssb_create(uv_loop_t* loop, JSContext* context, const char* db_path);
|
tf_ssb_t* tf_ssb_create(uv_loop_t* loop, JSContext* context, const char* db_path);
|
||||||
void tf_ssb_destroy(tf_ssb_t* ssb);
|
void tf_ssb_destroy(tf_ssb_t* ssb);
|
||||||
|
|
||||||
|
void tf_ssb_start_periodic(tf_ssb_t* ssb);
|
||||||
|
|
||||||
sqlite3* tf_ssb_acquire_db_reader(tf_ssb_t* ssb);
|
sqlite3* tf_ssb_acquire_db_reader(tf_ssb_t* ssb);
|
||||||
sqlite3* tf_ssb_acquire_db_reader_restricted(tf_ssb_t* ssb);
|
sqlite3* tf_ssb_acquire_db_reader_restricted(tf_ssb_t* ssb);
|
||||||
void tf_ssb_release_db_reader(tf_ssb_t* ssb, sqlite3* db);
|
void tf_ssb_release_db_reader(tf_ssb_t* ssb, sqlite3* db);
|
||||||
|
@ -1345,6 +1345,11 @@ static void _tf_ssb_rpc_start_delete_blobs(tf_ssb_t* ssb, int delay_ms)
|
|||||||
tf_ssb_ref(ssb);
|
tf_ssb_ref(ssb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tf_ssb_rpc_start_periodic(tf_ssb_t* ssb)
|
||||||
|
{
|
||||||
|
_tf_ssb_rpc_start_delete_blobs(ssb, 0);
|
||||||
|
}
|
||||||
|
|
||||||
void tf_ssb_rpc_register(tf_ssb_t* ssb)
|
void tf_ssb_rpc_register(tf_ssb_t* ssb)
|
||||||
{
|
{
|
||||||
tf_ssb_add_connections_changed_callback(ssb, _tf_ssb_rpc_connections_changed_callback, NULL, NULL);
|
tf_ssb_add_connections_changed_callback(ssb, _tf_ssb_rpc_connections_changed_callback, NULL, NULL);
|
||||||
@ -1358,5 +1363,4 @@ void tf_ssb_rpc_register(tf_ssb_t* ssb)
|
|||||||
tf_ssb_add_rpc_callback(ssb, (const char*[]) { "room", "attendants", NULL }, _tf_ssb_rpc_room_attendants, NULL, NULL); /* SOURCE */
|
tf_ssb_add_rpc_callback(ssb, (const char*[]) { "room", "attendants", NULL }, _tf_ssb_rpc_room_attendants, NULL, NULL); /* SOURCE */
|
||||||
tf_ssb_add_rpc_callback(ssb, (const char*[]) { "createHistoryStream", NULL }, _tf_ssb_rpc_createHistoryStream, NULL, NULL); /* SOURCE */
|
tf_ssb_add_rpc_callback(ssb, (const char*[]) { "createHistoryStream", NULL }, _tf_ssb_rpc_createHistoryStream, NULL, NULL); /* SOURCE */
|
||||||
tf_ssb_add_rpc_callback(ssb, (const char*[]) { "ebt", "replicate", NULL }, _tf_ssb_rpc_ebt_replicate_server, NULL, NULL); /* DUPLEX */
|
tf_ssb_add_rpc_callback(ssb, (const char*[]) { "ebt", "replicate", NULL }, _tf_ssb_rpc_ebt_replicate_server, NULL, NULL); /* DUPLEX */
|
||||||
_tf_ssb_rpc_start_delete_blobs(ssb, 0);
|
|
||||||
}
|
}
|
||||||
|
@ -3,3 +3,4 @@
|
|||||||
typedef struct _tf_ssb_t tf_ssb_t;
|
typedef struct _tf_ssb_t tf_ssb_t;
|
||||||
|
|
||||||
void tf_ssb_rpc_register(tf_ssb_t* ssb);
|
void tf_ssb_rpc_register(tf_ssb_t* ssb);
|
||||||
|
void tf_ssb_rpc_start_periodic(tf_ssb_t* ssb);
|
||||||
|
Loading…
Reference in New Issue
Block a user