Skip to content

Commit

Permalink
Fixed non-synchronized placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
A5H73Y committed Jun 4, 2024
1 parent 40448b8 commit aa4b883
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
![Parkour Logo](https://user-images.githubusercontent.com/6440871/208645721-b047416c-1ca3-471d-b146-6af9424ce639.png)

[![discord server](https://img.shields.io/discord/328154925949517824.svg)](https://discord.gg/h9d2fSd)
[![travis-ci](https://travis-ci.org/A5H73Y/Parkour.svg?branch=master)](https://travis-ci.org/A5H73Y/Parkour/branches)
[![license: MIT](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://tldrlegal.com/license/mit-license)
[![releases](https://img.shields.io/github/v/release/A5H73Y/Parkour.svg?label=github%20release)](https://github.com/A5H73Y/Parkour/releases/latest)
[![license: MIT](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://tldrlegal.com/license/mit-license)

Parkour is the original, most powerful Parkour based plugin available!
First released in November 2012, and has been updated since. Parkour is now open source, allowing you to contribute ideas and enhancements, or create your own spin on the plugin.<p />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public boolean persist() {
}

@Override
public String onRequest(final OfflinePlayer offlinePlayer,
final @NotNull String placeholder) {
public synchronized String onRequest(final OfflinePlayer offlinePlayer,
final @NotNull String placeholder) {
return retrieveValue(offlinePlayer, placeholder.toLowerCase(), placeholder.toLowerCase().split("_"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,12 +853,9 @@ private int calculateResultsLimit(int limit) {
}

private List<TimeEntry> getCourseCache(String courseName) {
if (!resultsCache.containsKey(courseName.toLowerCase())) {
resultsCache.put(courseName.toLowerCase(),
getTopCourseResults(courseName, getConfig().getMaximumCoursesCached()));
}

return resultsCache.get(courseName.toLowerCase());
String courseKey = courseName.toLowerCase();
return resultsCache.computeIfAbsent(courseKey,
key -> getTopCourseResults(key, getConfig().getMaximumCoursesCached()));
}

/**
Expand Down

0 comments on commit aa4b883

Please sign in to comment.