From c164d7281c4d9bc00abcaad59a6991509ddf3255 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milo=C5=A1=20Mula=C4=8D?= Date: Fri, 16 Feb 2007 16:05:58 +0000 Subject: [PATCH] half way to pbs seq.codes --- org.glite.lb.server/src/process_event_pbs.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/org.glite.lb.server/src/process_event_pbs.c b/org.glite.lb.server/src/process_event_pbs.c index c612f02..6effac6 100644 --- a/org.glite.lb.server/src/process_event_pbs.c +++ b/org.glite.lb.server/src/process_event_pbs.c @@ -20,6 +20,8 @@ #define UNUSED_VAR #endif +// XXX: maybe not needed any more +// if not, remove also last_pbs_event_timestamp from intJobStat static int compare_timestamps(struct timeval a, struct timeval b) { if ( (a.tv_sec > b.tv_sec) || @@ -29,6 +31,11 @@ static int compare_timestamps(struct timeval a, struct timeval b) return 0; } +static int compare_pbs_seqcodes(char *a, char *b) +{ + return (strcmp(a,b)); // simple minded, but should work +} + // XXX move this defines into some common place to be reusable #define USABLE(res) ((res) == RET_OK) #define USABLE_DATA(res) (1) @@ -43,8 +50,11 @@ int processEvent_PBS(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, c fputs("processEvent_PBS()",stderr); - if (compare_timestamps(js->last_pbs_event_timestamp, e->any.timestamp) > 0) + //if (compare_timestamps(js->last_pbs_event_timestamp, e->any.timestamp) > 0) + if ((js->last_seqcode != NULL) && + (compare_pbs_seqcodes(js->last_seqcode, e->any.seqcode) > 0) ) { res = RET_LATE; + } switch (e->any.type) { case EDG_WLL_EVENT_REGJOB: @@ -154,6 +164,8 @@ int processEvent_PBS(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, c } if (USABLE(res)) { + rep(js->last_seqcode, e->any.seqcode); + js->pub.lastUpdateTime = e->any.timestamp; if (old_state != js->pub.state) { js->pub.stateEnterTime = js->pub.lastUpdateTime; -- 1.8.2.3