# Functions
CanProceedChainExecution checks if particular chain can be exeuted in parallel.
CheckNeedMigrateDb checks need of upgrading database and throws error if that's true.
DeleteChainConfig delete chaing configuration for self destructive chains.
ExecuteCustomScripts executes SQL scripts in files.
ExecuteSQLCommand executes chain script with parameters inside transaction.
ExecuteSQLTask executes SQL task.
FinalizeConfigDBConnection closes session.
FinalizeRemoteDBConnection closes session.
FixSchedulerCrash make sure that task chains which are not complete due to a scheduler crash are "fixed"
and marked as stopped at a certain point */.
GetChainElements returns all elements for a given chain.
GetChainParamValues returns parameter values to pass for task being executed.
GetConnectionString of database_connection.
GetLogPrefix perform formatted logging.
GetLogPrefixLn perform formatted logging with new line at the end.
GetRemoteDBTransaction create a remote db connection and returns transaction object.
InitAndTestConfigDBConnection opens connection and creates schema.
InsertChainRunStatus inits the execution run log, which will be use to effectively control scheduler concurrency.
No description provided by the author
LogChainElementExecution will log current chain element execution status including retcode.
LogToDB performs logging to configuration database ConfigDB initiated during bootstrap.
MigrateDb upgrades database with all migrations.
MustCommitTransaction commits transaction and log error in the case of error.
No description provided by the author
MustRollbackTransaction rollbacks transaction and log error in the case of error.
No description provided by the author
ReconnectDbAndFixLeftovers keeps trying reconnecting every `waitTime` seconds till connection established.
ResetRole - RESET forms reset the current user identifier to be the current session user identifier.
SetRole - set the current user identifier of the current session.
SetupCloseHandler creates a 'listener' on a new goroutine which will notify the program if it receives an interrupt from the OS.
StartTransaction return transaction object and panic in the case of error.
TryLockClientName obtains lock on the server to prevent another client with the same name.
UpdateChainRunStatus inserts status information about running chain elements.
# Constants
AppID used as a key for obtaining locks on the server, it's Adler32 hash of 'pg_timetable' string.
InvalidOid specifies value for non-existent objects.
WaitTime specifies amount of time in seconds to wait before reconnecting to DB.
# Variables
ClientName is unique ifentifier of the scheduler application running.
ConfigDb is the global database object.
NoShellTasks parameter disables SHELL tasks executing.
OpenDB used for mocking purposes.
VerboseLogLevel specifies if log messages with level LOG should be logged.
# Structs
ChainElementExecution structure describes each chain execution process.