mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
Fixes an import error when using S3/Minio with no redis (#1224)
## Context Error is caused due to these steps: - File is uploaded to Home server and attempts to import - Import ends up in `claimDocument` in `HostedStorageManager` - Tries to read doc metadata from DocWorkerMap, gets 'unknown' as md5 hash - Thinks local doc is out of date and erases it. - Downloads a non-existent file from S3, so import fails as it has no data. ## Proposed solution This fixes it by checking for DummyDocWorker's special 'unknown' MD5, forcing an S3 check. ## Related issues https://community.getgrist.com/t/no-metadata-for-imported-grist-document/6029/32
This commit is contained in:
@@ -580,8 +580,10 @@ let dummyDocWorkerMap: DummyDocWorkerMap|null = null;
|
||||
|
||||
export function getDocWorkerMap(): IDocWorkerMap {
|
||||
if (process.env.REDIS_URL) {
|
||||
log.info("Creating Redis-based DocWorker");
|
||||
return new DocWorkerMap();
|
||||
} else {
|
||||
log.info("Creating local/dummy DocWorker");
|
||||
dummyDocWorkerMap = dummyDocWorkerMap || new DummyDocWorkerMap();
|
||||
return dummyDocWorkerMap;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user