Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

优化OpenAIClient类代码,双检锁单例加volatile修饰 #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class OpenAIClient {

public static final String OPENAI_KEY = "chatgpt.apiKey";

private static OpenAiStreamClient OPEN_AI_STREAM_CLIENT;
private static volatile OpenAiStreamClient OPEN_AI_STREAM_CLIENT;
private static String apiKey;

public static OpenAiStreamClient getInstance() {
Expand Down