Skip to content

fix email send #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2022
Merged
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 @@ -52,6 +52,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -327,7 +328,7 @@ public abstract class AbstractPhaseHandler implements PhaseHandler {
* But email should be send after updated success, so collect email message before update
* and send it after update
*/
private Map<String, List<TCSEmailMessage>> emailToSend = new HashMap<>();
private Map<String, List<TCSEmailMessage>> emailToSend = new ConcurrentHashMap<>();

/**
* The log instance used by this handler.
Expand Down Expand Up @@ -555,6 +556,7 @@ private void sendPhaseEmails(Phase phase, Map<String, Object> values, boolean bS
}

Map<Long, Map<String, String>> challengeIdCache = new HashMap<>();
emailToSend.remove(String.join(":", String.valueOf(phase.getId()), phase.getPhaseStatus().getName()));
for (long userID : userEmailSchemes.keySet()) {
EmailScheme emailScheme = userEmailSchemes.get(userID);
EmailOptions emailOptions = bStart ? emailScheme.getStartEmailOptions() : emailScheme.getEndEmailOptions();
Expand Down