mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-05 10:39:27 +02:00
cli: add functions for manually perform jobs
This commit is contained in:
parent
72fb4a854f
commit
22d6c67348
1 changed files with 19 additions and 1 deletions
|
@ -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 pthread_t imap_thread = 0;
|
||||||
static int run_threads = 1;
|
static int run_threads = 0;
|
||||||
static void* imap_thread_entry_point (void* entry_arg)
|
static void* imap_thread_entry_point (void* entry_arg)
|
||||||
{
|
{
|
||||||
dc_context_t* context = (dc_context_t*)entry_arg;
|
dc_context_t* context = (dc_context_t*)entry_arg;
|
||||||
|
@ -247,6 +247,24 @@ int main(int argc, char ** argv)
|
||||||
{
|
{
|
||||||
stop_threads(context);
|
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)
|
else if (strcmp(cmd, "configure")==0)
|
||||||
{
|
{
|
||||||
start_threads(context);
|
start_threads(context);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue