Last active
July 18, 2019 09:06
-
-
Save orcaman/4ee87bcd4f651b687b9288f949f8a3b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for _, d := range p.DatasetDescriptors { | |
for _, t := range d.TableDescriptors { | |
wg.Add(1) | |
go func(d *datasetDescriptor, t *tableDescriptor) { | |
rl.Take() | |
defer wg.Done() | |
schemaPath := *backupPath + "/" + d.Name + "/" + t.Name + "/schema.json" | |
if fileExists(ctx, schemaPath, bkt) { | |
return | |
} | |
err := writeSchemaFile(ctx, bkt, schemaPath, t.Schema) | |
if err != nil { | |
errc <- err | |
} | |
dataPath := "gs://" + *bucket + "/" + *backupPath + "/" + d.Name + "/" + t.Name + "/data-*.json" | |
err = p.writeDataFiles(ctx, dataPath, p.projectID, d.Name, t.Name) | |
if err != nil { | |
errc <- err | |
} | |
}(d, t) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment