+ Added file updating

This commit is contained in:
Matthew Cech
2019-05-05 22:10:48 -07:00
parent 99667330df
commit d252cf54b0
3 changed files with 15 additions and 2 deletions
+2
View File
@@ -30,6 +30,8 @@ public class CommandBenchmark extends Command
@Override @Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res) public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{ {
framework.Update();
if(input.args == null || input.args.length() == 0) if(input.args == null || input.args.length() == 0)
{ {
String output = HelpText(); String output = HelpText();
@@ -28,6 +28,14 @@ public class BenchmarkFramework
return ExecuteCommand(input.key, input); return ExecuteCommand(input.key, input);
} }
public void Update()
{
synchronized(benchmarkManager)
{
benchmarkManager.Update();
}
}
// Registers a command // Registers a command
private void RegisterCommand(String commandName, BenchmarkCommand command) private void RegisterCommand(String commandName, BenchmarkCommand command)
{ {
+4 -1
View File
@@ -174,7 +174,10 @@ public class BenchmarkManager
private void OnRescan(MonitoredFile file) private void OnRescan(MonitoredFile file)
{ {
// For now, all we need is to note that something was adjusted. // For now, all we need is to note that something was adjusted.
if(file.path.endsWith(extension)) if(file.path.toString().contains(extension))
{
BenchmarkLog.Log("File status changed: " + file.path);
needsUpdate = true; needsUpdate = true;
}
} }
} }