diff options
author | Tedd Hansen | 2008-02-02 07:53:13 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-02-02 07:53:13 +0000 |
commit | 785b641272f0e41c50d42406496baee10e5303a9 (patch) | |
tree | f6e37734d8e5b5e98d1dbf7e6a01b82b41773ea2 /OpenSim/Region/ScriptEngine/Common/ScriptEngineBase | |
parent | Added commands to change config file from console: (diff) | |
download | opensim-SC-785b641272f0e41c50d42406496baee10e5303a9.zip opensim-SC-785b641272f0e41c50d42406496baee10e5303a9.tar.gz opensim-SC-785b641272f0e41c50d42406496baee10e5303a9.tar.bz2 opensim-SC-785b641272f0e41c50d42406496baee10e5303a9.tar.xz |
fixed a timing bug in config re-read. Apparently there is 1000000000 ns in one second...
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs | 12 |
2 files changed, 10 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs index ae6f001..57e56d4 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs | |||
@@ -90,12 +90,12 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
90 | m_ScriptEngine.Log.Warn(m_ScriptEngine.ScriptEngineName, | 90 | m_ScriptEngine.Log.Warn(m_ScriptEngine.ScriptEngineName, |
91 | "Configuration error: MaxEventExecutionTimeMs is less than MaintenanceLoopms. The Maintenance Loop will only check scripts once per run."); | 91 | "Configuration error: MaxEventExecutionTimeMs is less than MaintenanceLoopms. The Maintenance Loop will only check scripts once per run."); |
92 | 92 | ||
93 | long Last_maxFunctionExecutionTimens = 0; // DateTime.Now.Ticks; | ||
94 | long Last_ReReadConfigFilens = DateTime.Now.Ticks; | ||
93 | while (true) | 95 | while (true) |
94 | { | 96 | { |
95 | try | 97 | try |
96 | { | 98 | { |
97 | long Last_maxFunctionExecutionTimens = 0; // DateTime.Now.Ticks; | ||
98 | long Last_ReReadConfigFilens = DateTime.Now.Ticks; | ||
99 | while (true) | 99 | while (true) |
100 | { | 100 | { |
101 | System.Threading.Thread.Sleep(MaintenanceLoopms); // Sleep before next pass | 101 | System.Threading.Thread.Sleep(MaintenanceLoopms); // Sleep before next pass |
@@ -107,11 +107,12 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
107 | // | 107 | // |
108 | // Re-reading config every x seconds | 108 | // Re-reading config every x seconds |
109 | // | 109 | // |
110 | if (m_ScriptEngine.RefreshConfigFileSeconds > 0) | 110 | if (m_ScriptEngine.RefreshConfigFilens > 0) |
111 | { | 111 | { |
112 | // Check if its time to re-read config | 112 | // Check if its time to re-read config |
113 | if (DateTime.Now.Ticks - Last_ReReadConfigFilens > m_ScriptEngine.RefreshConfigFilens) | 113 | if (DateTime.Now.Ticks - Last_ReReadConfigFilens > m_ScriptEngine.RefreshConfigFilens) |
114 | { | 114 | { |
115 | //Console.WriteLine("Time passed: " + (DateTime.Now.Ticks - Last_ReReadConfigFilens) + ">" + m_ScriptEngine.RefreshConfigFilens ); | ||
115 | // Its time to re-read config file | 116 | // Its time to re-read config file |
116 | m_ScriptEngine.ReadConfig(); | 117 | m_ScriptEngine.ReadConfig(); |
117 | Last_ReReadConfigFilens = DateTime.Now.Ticks; // Reset time | 118 | Last_ReReadConfigFilens = DateTime.Now.Ticks; // Reset time |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs index 4cf39b4..f09e631 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs | |||
@@ -61,10 +61,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
61 | /// How many seconds between re-reading config-file. 0 = never. ScriptEngine will try to adjust to new config changes. | 61 | /// How many seconds between re-reading config-file. 0 = never. ScriptEngine will try to adjust to new config changes. |
62 | /// </summary> | 62 | /// </summary> |
63 | public int RefreshConfigFileSeconds { | 63 | public int RefreshConfigFileSeconds { |
64 | get { return (int)(RefreshConfigFilens / 10000); } | 64 | get { return (int)(RefreshConfigFilens / 10000000); } |
65 | set { RefreshConfigFilens = value * 10000; } | 65 | set { RefreshConfigFilens = value * 10000000; } |
66 | } | 66 | } |
67 | public long RefreshConfigFilens = 0; | 67 | public long RefreshConfigFilens; |
68 | 68 | ||
69 | public ScriptManager GetScriptManager() | 69 | public ScriptManager GetScriptManager() |
70 | { | 70 | { |
@@ -131,9 +131,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
131 | } | 131 | } |
132 | public void ReadConfig() | 132 | public void ReadConfig() |
133 | { | 133 | { |
134 | #if DEBUG | 134 | //#if DEBUG |
135 | Log.Debug(ScriptEngineName, "Refreshing configuration for all modules"); | 135 | // Log.Debug(ScriptEngineName, "Refreshing configuration for all modules"); |
136 | #endif | 136 | //#endif |
137 | RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 30); | 137 | RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 30); |
138 | 138 | ||
139 | // Reload from disk? No! | 139 | // Reload from disk? No! |