関数特性
言語: PLPGSQL
戻り値: integer
30 秒以内に 1 つも sync 事象が無い場合、sync 事象を生成します。declare
p_interval alias for $1;
v_node_row record;
BEGIN
select 1 into v_node_row from sl_event
where ev_type = 'SYNC' and ev_origin = getLocalNodeId('schemadoc')
and ev_timestamp > now() - p_interval limit 1;
if not found then
-- If there has been no SYNC in the last interval, then push one
perform createEvent('schemadoc', 'SYNC', NULL);
return 1;
else
return 0;
end if;
end;