Reputation: 1
I send an image file to a specific discord channel every minute with Quartz Scheduler. However, when image file is sent, my bot's console outputs the log below.
[Finalizer] WARN RestAction - Found unclosed resources in MessageAction instance, closing on finalization step!
Is it possible to disable log? Or did I do something wrong?
Files are sent well, but this log is very annoying because it prints out every time a file is sent to the console.
Here is my code (If you need):
ImageSendingJob.java
public class ImageSendingJob implements Job {
@Override
public void execute(JobExecutionContext context) {
TextChannel textChannel = JDA.guild.getTextChannelById("ID");
InputStream image = // Image
textChannel
.sendFile(image, String.format("%s.png", context.getFireTime()))
.complete();
}
}
SchedulerManager.java
private void startScheduler() {
SchedulerFactory schedulerFactory = new StdSchedulerFactory();
try {
Scheduler scheduler = schedulerFactory.getScheduler();
JobDetail job = newJob(ImageSendingJob.class)
.withIdentity("Job", Scheduler.DEFAULT_GROUP)
.build();
Trigger trigger = TriggerBuilder.newTrigger()
.withIdentity("JobTrigger", Scheduler.DEFAULT_GROUP)
.withSchedule(SimpleScheduleBuilder.simpleSchedule()
.withIntervalInSeconds(60)
.repeatForever())
.build();
scheduler.scheduleJob(job, trigger);
scheduler.start();
} catch (SchedulerException e) {
throw new RuntimeException(e);
}
}
Upvotes: 0
Views: 53