@Override
    public void run() {
        LocalDateTime currentTime = LocalDateTime.now();
        LocalDateTime latestTime = currentTime.minusHours(latestHours).truncatedTo(ChronoUnit.HOURS);
        Date modifyTime = Date.from(latestTime.atZone(ZoneId.systemDefault()).toInstant());

        List<String> groupIds = groupMapper.selectDeletedGroupIdsWithTimeAfter(modifyTime, batchSize);
        if (CollectionUtils.isEmpty(groupIds)) {
            return;
        }

        deleteSources(groupIds);
    }
Delete all stream source which is running but its inlong group was deleted.
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/task/DeleteStreamSourceTask.java