updated obj_Post_Log(Post) to notify FI if an error is encountered and continue processing other records
This commit is contained in:
@ -20,9 +20,9 @@ COMPILE FUNCTION obj_Post_Log(Method,Parms)
|
|||||||
|
|
||||||
|
|
||||||
DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, Get_Property, obj_RDS, Database_Services, Environment_Services
|
DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, Get_Property, obj_RDS, Database_Services, Environment_Services
|
||||||
DECLARE FUNCTION Logging_Services, Datetime, SRP_DateTime, GetTickCount
|
DECLARE FUNCTION Logging_Services, Datetime, SRP_DateTime, GetTickCount, SRP_Datetime
|
||||||
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, Send_Dyn, RList, obj_WO_Log, Send_Event, obj_RDS
|
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, Send_Dyn, RList, obj_WO_Log, Send_Event, obj_RDS
|
||||||
DECLARE SUBROUTINE obj_WO_Mat, Send_Info, obj_Notes, ErrMsg, Logging_Services, Mona_Services
|
DECLARE SUBROUTINE obj_WO_Mat, Send_Info, obj_Notes, ErrMsg, Logging_Services, Mona_Services, Database_Services
|
||||||
|
|
||||||
|
|
||||||
$INSERT POST_LOG_EQUATES
|
$INSERT POST_LOG_EQUATES
|
||||||
@ -222,12 +222,44 @@ Post:
|
|||||||
|
|
||||||
IF Get_Status(errCode) THEN
|
IF Get_Status(errCode) THEN
|
||||||
Set_Status(0)
|
Set_Status(0)
|
||||||
obj_Tables('UnlockRec',PlParms)
|
|
||||||
obj_Tables('UnlockRec',UFParms)
|
Tablename = Field(UFParms, @RM, 1, 1)
|
||||||
ClearSelect CursorVar
|
Key = Field(UFParms, @RM, 2, 1)
|
||||||
// 4/22/19 Added unlock statement to prevent POST_LOG service from locking up
|
Database_Services('ReleaseKeyIDLock', Tablename, Key)
|
||||||
Unlock hSysLists, ServiceKeyID else Null
|
|
||||||
RETURN
|
CurrDtm = Datetime()
|
||||||
|
FailureNotificationSent = PostLogRec<POST_LOG_FAILURE_NOTIFICATION_SENT$>
|
||||||
|
FailureNotificationDtm = PostLogRec<POST_LOG_FAILURE_NOTIFICATION_DTM$>
|
||||||
|
If FailureNotificationDtm NE '' then
|
||||||
|
SendReminder = ( SRP_Datetime('HourSpan', FailureNotificationDtm, CurrDtm) GE 1 )
|
||||||
|
end else
|
||||||
|
SendReminder = False$
|
||||||
|
end
|
||||||
|
If ( (FailureNotificationSent NE True$) or (SendReminder EQ True$) ) then
|
||||||
|
PostLogRec<POST_LOG_FAILED$> = True$
|
||||||
|
PostLogRec<POST_LOG_FAILURE_REASON$> = errCode
|
||||||
|
PostLogRec<POST_LOG_FAILURE_NOTIFICATION_SENT$> = True$
|
||||||
|
PostLogRec<POST_LOG_FAILURE_NOTIFICATION_DTM$> = CurrDtm
|
||||||
|
Database_Services('WriteDataRow', 'POST_LOG', PostLogKey, PostLogRec, True$, False$, False$)
|
||||||
|
|
||||||
|
// Notify OI_SYSADMIN group
|
||||||
|
Server = Environment_Services('GetServer')
|
||||||
|
Recipients = ''
|
||||||
|
SentFrom = 'SYSTEM'
|
||||||
|
Subject = 'Obj_Post_Log("Post") Error'
|
||||||
|
Message = OConv(CurrDtm, 'DT2/^H')
|
||||||
|
Message<2> = 'Error on server ':Server
|
||||||
|
Message<3> = 'Failed to write record ':Tablename:' ':Key:' . Error_Services error message: ':errCode
|
||||||
|
Swap @FM with \0D0A\ in Message
|
||||||
|
AttachWindow = ''
|
||||||
|
AttachKey = ''
|
||||||
|
SendToGroup = 'OI_SYSADMIN'
|
||||||
|
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||||
|
obj_Notes('Create',Parms)
|
||||||
|
end else
|
||||||
|
Database_Services('ReleaseKeyIDLock', 'POST_LOG', PostLogKey)
|
||||||
|
end
|
||||||
|
|
||||||
END ELSE
|
END ELSE
|
||||||
obj_Tables('DeleteRec',PlParms)
|
obj_Tables('DeleteRec',PlParms)
|
||||||
END
|
END
|
||||||
|
@ -11,6 +11,11 @@ Equ POST_LOG_REC_KEY1$ To 0
|
|||||||
Equ POST_LOG_REC_KEY2$ To 0
|
Equ POST_LOG_REC_KEY2$ To 0
|
||||||
Equ POST_LOG_REC_KEY3$ To 0
|
Equ POST_LOG_REC_KEY3$ To 0
|
||||||
|
|
||||||
Equ POST_LOG_FIELD_NO$ To 1
|
Equ POST_LOG_FIELD_NO$ To 1
|
||||||
Equ POST_LOG_FIELD_VALUE$ To 2
|
Equ POST_LOG_FIELD_VALUE$ To 2
|
||||||
Equ POST_LOG_FIELD_ADD_MV_BY$ To 3
|
Equ POST_LOG_FIELD_ADD_MV_BY$ To 3
|
||||||
|
Equ POST_LOG_FAILED$ To 4
|
||||||
|
Equ POST_LOG_FAILURE_REASON$ To 5
|
||||||
|
Equ POST_LOG_FAILURE_NOTIFICATION_SENT$ To 6
|
||||||
|
Equ POST_LOG_FAILURE_NOTIFICATION_DTM$ To 7
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user