Make timer auto-respawn.

bulletsim
Sean McNamara 2011-02-25 08:57:48 -05:00
parent 7fa8ed0c47
commit bb1f03abc6
1 changed files with 6 additions and 3 deletions

View File

@ -275,9 +275,11 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
st.SetEnabled(false); st.SetEnabled(false);
return; return;
} }
st.SetTimer(new Timer(interval)); //Milliseconds -> minutes Timer tim = new Timer(interval);
timers.Add(interval, st.GetTimer()); st.SetTimer(tim); //Milliseconds -> minutes
st.GetTimer().Elapsed += HandleElapsed; timers.Add(interval, tim);
tim.Elapsed += HandleElapsed;
tim.AutoReset = True;
m_log.Debug("[AUTO BACKUP MODULE]: New timer for " + interval + " msec for region " + sRegionName); m_log.Debug("[AUTO BACKUP MODULE]: New timer for " + interval + " msec for region " + sRegionName);
} }
@ -351,6 +353,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
{ {
IRegionArchiverModule iram = scene.RequestModuleInterface<IRegionArchiverModule>(); IRegionArchiverModule iram = scene.RequestModuleInterface<IRegionArchiverModule>();
string savePath = BuildOarPath(scene.RegionInfo.RegionName, state.GetBackupDir(), state.GetNamingType()); string savePath = BuildOarPath(scene.RegionInfo.RegionName, state.GetBackupDir(), state.GetNamingType());
m_log.Debug("[AUTO BACKUP MODULE]: savePath = " + savePath);
if(savePath == null) if(savePath == null)
{ {
m_log.Warn("savePath is null in HandleElapsed"); m_log.Warn("savePath is null in HandleElapsed");