File tree Expand file tree Collapse file tree 3 files changed +28
-5
lines changed
api/modules/v1/components Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Original file line number Diff line number Diff line change 33 CreateBucketOutput ,
44 CreateBucketRequest ,
55 PutObjectOutput ,
6- S3 ,
76 GetObjectOutput ,
7+ ListObjectsOutput ,
8+ S3 ,
89} from "$deps" ;
910import {
1011 env ,
@@ -71,6 +72,24 @@ export class SimpleCloudStorage {
7172 }
7273 }
7374
75+ public async listObjects ( ) : Promise < ListObjectsOutput | undefined > {
76+ return this . handleListObjects ( ) ;
77+ }
78+
79+ private async handleListObjects ( ) {
80+ const s3 = this . makeNewBucket ( ) ;
81+
82+ try {
83+ const listObjects = await s3 . listObjects ( {
84+ Bucket : this . bucketName ,
85+ } ) ;
86+
87+ return listObjects ;
88+ } catch ( er ) {
89+ log . error ( er . message ) ;
90+ }
91+ }
92+
7493 public async downloadFileFromS3 ( objectKey : string ) : Promise < string | undefined > {
7594 return this . handleDownloadFile ( objectKey ) ;
7695 }
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { PersonService } from "$service/person/PersonService.ts";
33import {
44 everyMinute ,
55 every15Minute ,
6+ start
67} from '$deps' ;
78
89export class Slinger {
@@ -11,8 +12,9 @@ export class Slinger {
1112 }
1213
1314 private init ( ) {
14- this . handleDisareByMinute ( ) ;
15+ // this.handleDisareByMinute();
1516 this . handleDispareByFiftyMinute ( ) ;
17+ start ( ) ;
1618 }
1719
1820 private handleDisareByMinute ( ) {
@@ -22,7 +24,7 @@ export class Slinger {
2224 }
2325
2426 private handleDispareByFiftyMinute ( ) {
25- every15Minute ( async ( ) => {
27+ everyMinute ( async ( ) => {
2628 await new PersonService ( ) . listenAndInsertPersonFromQueue ( ) ;
2729 } ) ;
2830 }
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ export {
2424export {
2525 type CreateBucketOutput ,
2626 type CreateBucketRequest ,
27- type PutObjectOutput
27+ type PutObjectOutput ,
28+ type ListObjectsOutput ,
2829} from "https://deno.land/x/[email protected] /services/s3/structs.ts" ; 2930
3031export {
@@ -53,7 +54,8 @@ export {
5354 daily ,
5455 monthly ,
5556 weekly ,
56- yearly
57+ yearly ,
58+ start
5759} from "https://deno.land/x/[email protected] /cron.ts" ; 5860
5961export {
You can’t perform that action at this time.
0 commit comments