Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e38b2c

Browse files
author
Vladimir Ershov
committed
fix intersection
1 parentf08cb86 commit0e38b2c

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

‎src/scheduler_job.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ job_t *set_job_error(job_t *j, const char *fmt, ...)
462462

463463
intmove_job_to_log(job_t*j,boolstatus,boolprocess)
464464
{
465-
if(j->type==CronJob)_cron_move_job_to_log(j,status);
465+
if(j->type==CronJob)return_cron_move_job_to_log(j,status);
466466
return_at_move_job_to_log(j,status,process);
467467
}
468468

@@ -513,9 +513,9 @@ int move_at_job_process(int job_id)
513513
intset_at_job_done(job_t*job,char*error,int64resubmit,char**set_error)
514514
{
515515
char*this_error=NULL;
516-
Datumvalues[20];
517-
charnulls[20];
518-
Oidargtypes[20]= {INT4OID };
516+
Datumvalues[21];
517+
charnulls[21];
518+
Oidargtypes[21]= {INT4OID };
519519
boolcanceled= false;
520520
inti;
521521
char*oldpath;
@@ -524,8 +524,9 @@ int set_at_job_done(job_t *job, char *error, int64 resubmit, char **set_error)
524524
intn=1;
525525
spi_response_t*r;
526526
spi_response_t*r2;
527+
527528
constchar*get_sql="select * from at_jobs_process where id = $1";
528-
constchar*insert_sql="insert into at_jobs_done values($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20)";
529+
constchar*insert_sql="insert into at_jobs_done values($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21)";
529530
constchar*delete_sql="delete from at_jobs_process where id = $1";
530531
constchar*resubmit_sql="insert into at_jobs_submitted values($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17)";
531532

@@ -558,8 +559,10 @@ int set_at_job_done(job_t *job, char *error, int64 resubmit, char **set_error)
558559
}
559560
argtypes[18]=BOOLOID;
560561
argtypes[19]=TEXTOID;
562+
argtypes[20]=TIMESTAMPTZOID;
561563
nulls[18]=' ';
562564
nulls[19]=' ';
565+
nulls[20]=' ';
563566

564567
canceled=nulls[15]=='n' ? false:DatumGetBool(values[15]);
565568

@@ -569,10 +572,11 @@ int set_at_job_done(job_t *job, char *error, int64 resubmit, char **set_error)
569572
{
570573
this_error=_copy_string("job was canceled while processing: cannot resubmit");
571574
sql=insert_sql;
572-
n=20;
575+
n=21;
573576

574577
values[18]=BoolGetDatum(false);
575578
values[19]=CStringGetTextDatum(this_error);
579+
values[20]=TimestampTzGetDatum(GetCurrentTimestamp());
576580
}
577581
elseif(job->attempt+1<job->resubmit_limit)
578582
{
@@ -585,15 +589,16 @@ int set_at_job_done(job_t *job, char *error, int64 resubmit, char **set_error)
585589
{
586590
this_error=_copy_string("resubmit limit reached");
587591
sql=insert_sql;
588-
n=20;
592+
n=21;
589593

590594
values[18]=BoolGetDatum(false);
591595
values[19]=CStringGetTextDatum(this_error);
596+
values[20]=TimestampTzGetDatum(GetCurrentTimestamp());
592597
}
593598
}
594599
else
595600
{
596-
n=20;
601+
n=21;
597602
sql=insert_sql;
598603
if(error)
599604
{
@@ -605,6 +610,7 @@ int set_at_job_done(job_t *job, char *error, int64 resubmit, char **set_error)
605610
values[18]=BoolGetDatum(true);
606611
nulls[19]='n';
607612
}
613+
values[20]=TimestampTzGetDatum(GetCurrentTimestamp());
608614
}
609615
r2=execute_spi_sql_with_args(sql,n,argtypes,values,nulls);
610616
if(this_error)pfree(this_error);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp