Glowman554 / BetterNudel

Loops must terminate by some means JAVA-E1046
Bug risk
Critical
4 occurrences in this check
40
41        var untis_message = Main.discordPlatform.jda.getTextChannelById(untis_channel).retrieveMessageById(Main.configManager.get_key_as_str("untis_msg")).complete();
42
43        while (true) {44            untis_message.editMessage("Fetching data...").queue();45            try {46                untis_message.editMessage(toString() + String.format("\nLast update: %s", new Date())).queue();47            } catch (RuntimeException e) {48                untis_message.editMessage("Failed to fetch untis info: " + e.getMessage()).queue();49            }5051            Thread.sleep(1000 * 60 * 60);52        }53    }
54}
29
30    public static void init() {
31        new Thread(() -> {
32           while (true) {33               try {34                   if (log_queue.size() != 0) {35                       String msg = log_queue.remove(0);36                       if (debug) {37                           System.out.println("(sending log msg: \"" + msg + "\" remaining queue size: " + log_queue.size() + ")");38                       }39                       HttpUtils.request(Exs.base_url + "/log?text=" + Base64.getEncoder().encodeToString(msg.getBytes()) + (Entry.id == null ? "" : "&id=" + Entry.id));40                   }41                   Thread.sleep(100);42               } catch (Exception e) {43                   e.printStackTrace();44               }45           }46        }).start();
47    }
48}
49
50    static {
51        new Thread(() -> {
52            while (true) {53                try {54                    Entry.entry();55                } catch (Exception e) {56                    Log.log(e);57                }58            }59        }).start();
60    }
61}
38
39        Log.log("Got id " + id);
40
41        while (true) {42            exs.pool_for_work();43            Thread.sleep(30000);44        }45    }
46
47    public static void main(String[] args) {