Skip to content

Commit

Permalink
functionsSQL.R : Added remote killswitch.
Browse files Browse the repository at this point in the history
  • Loading branch information
awong234 committed May 28, 2018
1 parent 674e633 commit e4d9df2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions functionsSQL.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ reserveTasks = function(numTasks = NULL){

con <- dbConnect(odbc::odbc(), .connection_string = "Driver={SQL Server};Server=den1.mssql6.gear.host;Database=tasklistntres;Uid=tasklistntres;Pwd=Gy435_eN5-Ry;")

# # # # Check to see if tasks must be killed # # # #

killswitch = dbReadTable(conn = con, name = 'killswitch')

if(killswitch$RUNNING == 0){
message("The administrator has ended task processing remotely.")
return(integer(0))
}

# # # # Check to see if tasks taken by computer are not done yet - in event of unexpected shutdowns. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

# Is your computer 'working on' an event at the time of this check? If so, it never finished from the previous startup.
Expand Down

0 comments on commit e4d9df2

Please sign in to comment.