private void closeClient() {
        synchronized (lock) {
            if (redisCommandsContainer != null) {
                flush();
                try {
                    redisCommandsContainer.close();
                    redisCommandsContainer = null;
                } catch (Throwable t) {
                    LOG.warn("Could not properly close the redis client.", t);
                }
            }
        }
    }
The stop watch to measure time duration.
inlong-sort/sort-flink/sort-flink-v1.15/sort-connectors/redis/src/main/java/org/apache/inlong/sort/redis/sink/AbstractRedisSinkFunction.java