mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Create read stream after all early return checks
This commit is contained in:
parent
444d4a69eb
commit
6f588e2170
1 changed files with 5 additions and 7 deletions
|
|
@ -195,13 +195,6 @@ const contentHandler = async (
|
|||
|
||||
const handleEvent = async (data: StorageEvent) => {
|
||||
if (shouldHandle(data)) {
|
||||
console.log('handling csv data', data)
|
||||
|
||||
const stream = storage
|
||||
.bucket(data.bucket)
|
||||
.file(data.name)
|
||||
.createReadStream()
|
||||
|
||||
const handler = handlerForFile(data.name)
|
||||
if (!handler) {
|
||||
console.log('no handler for file:', data.name)
|
||||
|
|
@ -220,6 +213,11 @@ const handleEvent = async (data: StorageEvent) => {
|
|||
return
|
||||
}
|
||||
|
||||
const stream = storage
|
||||
.bucket(data.bucket)
|
||||
.file(data.name)
|
||||
.createReadStream()
|
||||
|
||||
const ctx = {
|
||||
userId,
|
||||
countImported: 0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue