shoudl safe content again as data in the DB
This commit is contained in:
parent
45e18c2a99
commit
7b1f95bcd5
@ -179,7 +179,7 @@ public class Datahandler {
|
||||
|
||||
public void updateStringCache() {
|
||||
try {
|
||||
checkIfUpdateStrings(true);
|
||||
checkIfUpdateStrings();
|
||||
} catch (CustomError ex) {
|
||||
Logger.getLogger(Datahandler.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
@ -413,7 +413,7 @@ public class Datahandler {
|
||||
return stringIteratorComparator(strmap, strCacheLocal, localJMWEMap, localPipelineAnnotation, localPipelineSentimentAnnotation, localCoreDocumentMap);
|
||||
}
|
||||
|
||||
public synchronized void checkIfUpdateStrings(boolean hlStatsMsg) throws CustomError {
|
||||
public synchronized void checkIfUpdateStrings() throws CustomError {
|
||||
if (stopwatch.elapsed(TimeUnit.SECONDS) >= EXPIRE_TIME_IN_SECONDS || !stopwatch.isRunning()) {
|
||||
ConcurrentMap<Integer, String> str = MessageResponseHandler.getStr();
|
||||
System.out.println("str size: " + str.size());
|
||||
|
@ -57,15 +57,13 @@ public class DoStuff {
|
||||
}
|
||||
}
|
||||
List<User> blockLast = event.getMessage().getUserMentions().buffer().blockLast();
|
||||
String content = event.getMessage().getContent();
|
||||
if (!channelpermissionsDenied && blockLast != null) {
|
||||
String content = event.getMessage().getContent();
|
||||
if (blockLast != null) {
|
||||
for (User user : blockLast) {
|
||||
content = content.replace(user.getId().asString(), "");
|
||||
}
|
||||
}
|
||||
MessageResponseHandler.getMessage(content);
|
||||
}
|
||||
MessageResponseHandler.getMessage(content);
|
||||
boolean mentionedBot = false;
|
||||
if (blockLast != null){
|
||||
for (User user : blockLast)
|
||||
@ -80,7 +78,6 @@ public class DoStuff {
|
||||
if (mentionedBot || channelName.contains("general-autism")) {
|
||||
try {
|
||||
String ResponseStr;
|
||||
String content = event.getMessage().getContent();
|
||||
ResponseStr = MessageResponseHandler.selectReponseMessage(content, username);
|
||||
if (!ResponseStr.isEmpty()) {
|
||||
System.out.print("\nResponseStr3: " + ResponseStr + "\n");
|
||||
@ -93,7 +90,7 @@ public class DoStuff {
|
||||
}
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Datahandler.instance.checkIfUpdateStrings(false);
|
||||
Datahandler.instance.checkIfUpdateStrings();
|
||||
} catch (CustomError ex) {
|
||||
Logger.getLogger(DiscordHandler.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Sun Nov 01 23:59:26 CET 2020
|
||||
#Mon Nov 02 09:03:03 CET 2020
|
||||
version=1.0
|
||||
groupId=com.mycompany
|
||||
artifactId=ArtificialAutism
|
||||
|
Loading…
Reference in New Issue
Block a user