1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-04 18:29:19 +02:00

cli: add functions for manually perform jobs

This commit is contained in:
B. Petersen 2018-07-13 00:16:42 +02:00
parent 72fb4a854f
commit 22d6c67348

View file

@ -126,7 +126,7 @@ static uintptr_t receive_event(dc_context_t* context, int event, uintptr_t data1
static pthread_t imap_thread = 0;
static int run_threads = 1;
static int run_threads = 0;
static void* imap_thread_entry_point (void* entry_arg)
{
dc_context_t* context = (dc_context_t*)entry_arg;
@ -247,6 +247,24 @@ int main(int argc, char ** argv)
{
stop_threads(context);
}
else if (strcmp(cmd, "smtp-jobs")==0)
{
if (run_threads) {
printf("smtp-jobs are already running in a thread.\n");
}
else {
dc_perform_smtp_jobs(context);
}
}
else if (strcmp(cmd, "imap-jobs")==0)
{
if (run_threads) {
printf("imap-jobs are already running in a thread.\n");
}
else {
dc_perform_imap_jobs(context);
}
}
else if (strcmp(cmd, "configure")==0)
{
start_threads(context);