mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 13:19:02 +00:00
(minor) Fix test and improve error message
This commit is contained in:
parent
52a0255814
commit
98f3382cea
@ -230,6 +230,9 @@ public class FileStorageService {
|
|||||||
{
|
{
|
||||||
var base = getStorageBase(FileStorageBaseType.forFileStorageType(type));
|
var base = getStorageBase(FileStorageBaseType.forFileStorageType(type));
|
||||||
|
|
||||||
|
if (null == base)
|
||||||
|
throw new IllegalStateException("No storage base for type " + type + " on node " + node);
|
||||||
|
|
||||||
Path newDir = allocateDirectory(base.asPath(), prefix);
|
Path newDir = allocateDirectory(base.asPath(), prefix);
|
||||||
|
|
||||||
String relDir = base.asPath().relativize(newDir).normalize().toString();
|
String relDir = base.asPath().relativize(newDir).normalize().toString();
|
||||||
|
@ -118,6 +118,10 @@ public class FileStorageServiceTest {
|
|||||||
public void testAllocateTemp() throws IOException, SQLException {
|
public void testAllocateTemp() throws IOException, SQLException {
|
||||||
String name = "test-" + UUID.randomUUID();
|
String name = "test-" + UUID.randomUUID();
|
||||||
|
|
||||||
|
// ensure a base exists
|
||||||
|
var base = fileStorageService.createStorageBase(name, createTempDir(), FileStorageBaseType.STORAGE);
|
||||||
|
tempDirs.add(base.asPath());
|
||||||
|
|
||||||
var storage = new FileStorageService(dataSource, 0);
|
var storage = new FileStorageService(dataSource, 0);
|
||||||
|
|
||||||
var fileStorage = storage.allocateStorage(FileStorageType.CRAWL_DATA, "xyz", "thisShouldSucceed");
|
var fileStorage = storage.allocateStorage(FileStorageType.CRAWL_DATA, "xyz", "thisShouldSucceed");
|
||||||
|
Loading…
Reference in New Issue
Block a user