mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Improve/add some comments for clarity
This commit is contained in:
parent
def383574e
commit
a7198764cb
2 changed files with 12 additions and 5 deletions
|
@ -78,11 +78,12 @@ async function sendStream(bucketName, key, readStream, sourceMd5) {
|
||||||
|
|
||||||
const meteredStream = PersistorHelper.getMeteredStream(
|
const meteredStream = PersistorHelper.getMeteredStream(
|
||||||
readStream,
|
readStream,
|
||||||
'gcs.egress'
|
'gcs.egress' // egress from us to gcs
|
||||||
)
|
)
|
||||||
|
|
||||||
const writeOptions = {
|
const writeOptions = {
|
||||||
resumable: false // recommended by Google
|
// disabling of resumable uploads is recommended by Google:
|
||||||
|
resumable: false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sourceMd5) {
|
if (sourceMd5) {
|
||||||
|
@ -126,7 +127,10 @@ async function getFileStream(bucketName, key, opts = {}) {
|
||||||
.file(key)
|
.file(key)
|
||||||
.createReadStream(opts)
|
.createReadStream(opts)
|
||||||
|
|
||||||
const meteredStream = PersistorHelper.getMeteredStream(stream, 'gcs.ingress')
|
const meteredStream = PersistorHelper.getMeteredStream(
|
||||||
|
stream,
|
||||||
|
'gcs.ingress' // ingress to us from gcs
|
||||||
|
)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await PersistorHelper.waitForStreamReady(stream)
|
await PersistorHelper.waitForStreamReady(stream)
|
||||||
|
|
|
@ -74,7 +74,7 @@ async function sendStream(bucketName, key, readStream, sourceMd5) {
|
||||||
|
|
||||||
const meteredStream = PersistorHelper.getMeteredStream(
|
const meteredStream = PersistorHelper.getMeteredStream(
|
||||||
readStream,
|
readStream,
|
||||||
's3.egress'
|
's3.egress' // egress from us to s3
|
||||||
)
|
)
|
||||||
|
|
||||||
// if we have an md5 hash, pass this to S3 to verify the upload
|
// if we have an md5 hash, pass this to S3 to verify the upload
|
||||||
|
@ -139,7 +139,10 @@ async function getFileStream(bucketName, key, opts) {
|
||||||
.getObject(params)
|
.getObject(params)
|
||||||
.createReadStream()
|
.createReadStream()
|
||||||
|
|
||||||
const meteredStream = PersistorHelper.getMeteredStream(stream, 's3.ingress')
|
const meteredStream = PersistorHelper.getMeteredStream(
|
||||||
|
stream,
|
||||||
|
's3.ingress' // ingress to us from s3
|
||||||
|
)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await PersistorHelper.waitForStreamReady(stream)
|
await PersistorHelper.waitForStreamReady(stream)
|
||||||
|
|
Loading…
Reference in a new issue