forked from Qortal/qortal
FOLLOWED_AND_VIEWED renamed to FOLLOWED_OR_VIEWED, since it's technically an OR not an AND.
This commit is contained in:
parent
f58a16905f
commit
5ba6f6f53e
@ -102,7 +102,7 @@ public class ArbitraryDataManager extends Thread {
|
|||||||
// Fetch data according to storage policy
|
// Fetch data according to storage policy
|
||||||
switch (Settings.getInstance().getStoragePolicy()) {
|
switch (Settings.getInstance().getStoragePolicy()) {
|
||||||
case FOLLOWED:
|
case FOLLOWED:
|
||||||
case FOLLOWED_AND_VIEWED:
|
case FOLLOWED_OR_VIEWED:
|
||||||
this.processNames();
|
this.processNames();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import java.util.stream.Collectors;
|
|||||||
public class ArbitraryDataStorageManager extends Thread {
|
public class ArbitraryDataStorageManager extends Thread {
|
||||||
|
|
||||||
public enum StoragePolicy {
|
public enum StoragePolicy {
|
||||||
FOLLOWED_AND_VIEWED,
|
FOLLOWED_OR_VIEWED,
|
||||||
FOLLOWED,
|
FOLLOWED,
|
||||||
VIEWED,
|
VIEWED,
|
||||||
ALL,
|
ALL,
|
||||||
@ -126,7 +126,7 @@ public class ArbitraryDataStorageManager extends Thread {
|
|||||||
|
|
||||||
// Check if our storage policy and and lists allow us to host data for this name
|
// Check if our storage policy and and lists allow us to host data for this name
|
||||||
switch (Settings.getInstance().getStoragePolicy()) {
|
switch (Settings.getInstance().getStoragePolicy()) {
|
||||||
case FOLLOWED_AND_VIEWED:
|
case FOLLOWED_OR_VIEWED:
|
||||||
case ALL:
|
case ALL:
|
||||||
case VIEWED:
|
case VIEWED:
|
||||||
// If the policy includes viewed data, we can host it as long as it's not blocked
|
// If the policy includes viewed data, we can host it as long as it's not blocked
|
||||||
@ -189,7 +189,7 @@ public class ArbitraryDataStorageManager extends Thread {
|
|||||||
|
|
||||||
switch (Settings.getInstance().getStoragePolicy()) {
|
switch (Settings.getInstance().getStoragePolicy()) {
|
||||||
case FOLLOWED:
|
case FOLLOWED:
|
||||||
case FOLLOWED_AND_VIEWED:
|
case FOLLOWED_OR_VIEWED:
|
||||||
return this.isFollowingName(name);
|
return this.isFollowingName(name);
|
||||||
|
|
||||||
case ALL:
|
case ALL:
|
||||||
@ -217,7 +217,7 @@ public class ArbitraryDataStorageManager extends Thread {
|
|||||||
case NONE:
|
case NONE:
|
||||||
case VIEWED:
|
case VIEWED:
|
||||||
case FOLLOWED:
|
case FOLLOWED:
|
||||||
case FOLLOWED_AND_VIEWED:
|
case FOLLOWED_OR_VIEWED:
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ public class ArbitraryDataStoragePolicyTests extends Common {
|
|||||||
assertTrue(ResourceListManager.getInstance().addToList("followedNames", name, false));
|
assertTrue(ResourceListManager.getInstance().addToList("followedNames", name, false));
|
||||||
|
|
||||||
// We should store and pre-fetch data for this transaction
|
// We should store and pre-fetch data for this transaction
|
||||||
assertEquals(StoragePolicy.FOLLOWED_AND_VIEWED, Settings.getInstance().getStoragePolicy());
|
assertEquals(StoragePolicy.FOLLOWED_OR_VIEWED, Settings.getInstance().getStoragePolicy());
|
||||||
assertTrue(storageManager.canStoreData(transactionData));
|
assertTrue(storageManager.canStoreData(transactionData));
|
||||||
assertTrue(storageManager.shouldPreFetchData(repository, transactionData));
|
assertTrue(storageManager.shouldPreFetchData(repository, transactionData));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user