@Override
    public boolean sourceFinish() {
        if (sourceError) {
            return true;
        }
        if (isRealTime) {
            return false;
        }
        if (emptyCount == 0) {
            return false;
        }
        if (profile.isRetry()) {
            return true;
        }
        if (AgentUtils.getCurrentTime() - getLastModifyTime() > SOURCE_NO_UPDATE_INTERVAL_MS) {
            return true;
        }
        return false;
    }
Release the source resource if needed
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/file/AbstractSource.java