Skip to content

Commit 79c41d9

Browse files
authored
.z.exit update when STP is in memory batch mode (#707)
* Update stplog.q When the STP is in memorybatch mode, .z.exit will now update log file with whatever data is in memory during unexpected shutdown. * Update stplog.q Stylistic update based off Jonathon McMurray's comments. * Update stplog.q Comment alignment. * Update stplog.q Fixing comments to align with the rest of the function.
1 parent ea7cb8c commit 79c41d9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

code/segmentedtickerplant/stplog.q

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,14 @@ init:{[dbname]
283283
.dotz.set[`.z.exit;{
284284
if[not x~0i;.lg.e[`stpexit;"Bad exit!"];:()];
285285
.lg.o[`stpexit;"Exiting process"];
286+
287+
// flushing in memory data to disk during unexpected shutdown when batchmode is set to memorybatch
288+
if[.stplg.batchmode=`memorybatch;
289+
.lg.o[`stpexit;"STP shutdown unexpectedly, batchmode = `memorybatch, therefore flushing any remaining data to the on-disk log file"];
290+
.stplg.zts.memorybatch[];
291+
.lg.o[`stpexit; "Complete!"]
292+
];
293+
286294
// exit before logs are touched if process is an sctp NOT in create mode
287295
if[.sctp.chainedtp and not .sctp.loggingmode=`create; :()];
288296
.lg.o[`stpexit;"Closing off log files"];

0 commit comments

Comments
 (0)