mirror of
https://github.com/diced/zipline.git
synced 2025-03-28 23:11:22 -05:00
fix: maybe fix exports
This commit is contained in:
parent
b8729a6ec7
commit
3bf43f1606
3 changed files with 11 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
import {
|
||||
Anchor,
|
||||
Box,
|
||||
Button,
|
||||
Card,
|
||||
|
@ -383,7 +384,11 @@ export default function Manage() {
|
|||
rows={
|
||||
exports
|
||||
? exports.map((x, i) => ({
|
||||
name: <Link href={'/api/user/export?name=' + x.full}>Export {i + 1}</Link>,
|
||||
name: (
|
||||
<Anchor target='_blank' href={'/api/user/export?name=' + x.full}>
|
||||
Export {i + 1}
|
||||
</Anchor>
|
||||
),
|
||||
date: x.date.toLocaleString(),
|
||||
size: bytesToRead(x.size),
|
||||
}))
|
||||
|
|
|
@ -14,12 +14,9 @@ export class S3 extends Datasource {
|
|||
accessKey: config.access_key_id,
|
||||
secretKey: config.secret_access_key,
|
||||
pathStyle: config.force_s3_path,
|
||||
port: 9000,
|
||||
useSSL: config.use_ssl,
|
||||
region: config.region,
|
||||
});
|
||||
|
||||
// this.s3.
|
||||
}
|
||||
|
||||
public async save(file: string, data: Buffer): Promise<void> {
|
||||
|
|
|
@ -87,7 +87,8 @@ async function handler(req: NextApiReq, res: NextApiRes) {
|
|||
Logger.get('user').info(`Export for ${user.username} (${user.id}) has started`);
|
||||
for (let i = 0; i !== files.length; ++i) {
|
||||
const file = files[i];
|
||||
const stream = datasource.get(file.file);
|
||||
// try {
|
||||
const stream = await datasource.get(file.file);
|
||||
if (stream) {
|
||||
const def = new ZipPassThrough(file.file);
|
||||
zip.add(def);
|
||||
|
@ -101,6 +102,9 @@ async function handler(req: NextApiReq, res: NextApiRes) {
|
|||
stream.on('data', (c) => def.push(c));
|
||||
stream.on('end', () => def.push(new Uint8Array(0), true));
|
||||
}
|
||||
// } catch (e) {
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
zip.end();
|
||||
|
|
Loading…
Add table
Reference in a new issue