Skip to content

Commit

Permalink
fix(sonar): fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bezoerb committed Jan 19, 2024
1 parent fcd58db commit df8f844
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
14 changes: 8 additions & 6 deletions packages/contentful-ssg/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,15 @@ program
if (cmd.poll) {
const poll = () => {
setTimeout(
async () => {
prev = await run({ ...verified, sync: true }, prev);
if (useCache) {
await cache.setSyncState(prev);
}
() => {
(async () => {
prev = await run({ ...verified, sync: true }, prev);
if (useCache) {
await cache.setSyncState(prev);
}

poll();
poll();
})();
},
parseInt(cmd.pollIntervall, 10),
);
Expand Down
7 changes: 0 additions & 7 deletions packages/contentful-ssg/src/lib/contentful.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,7 @@ export const pagedGet = async <T, R extends CollectionResponse<T> = ContentfulCo
* @param apiClient Contentful API client
* @returns Promise for the collection resulting of a sync operation
*/

// type SyncCollectionClean = Omit<SyncCollection<EntrySkeletonType>, 'entries' | 'assets'> & {
// entries: EntryRaw[];
// assets: AssetRaw[];
// };

type SyncCollection = ContentfulSyncCollection<EntrySkeletonType, 'WITH_ALL_LOCALES'>;

const sync = async (apiClient: ClientApi, config: ContentfulConfig): Promise<SyncCollection> => {
const cache = initializeCache(config);
const options: SyncOptions = { initial: true };
Expand Down
1 change: 0 additions & 1 deletion packages/cssg-plugin-assets/src/helper/asset.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { type Asset } from '@jungvonmatt/contentful-ssg';
import { Presets, SingleBar } from 'cli-progress';
import { existsSync, promises } from 'fs';
import got from 'got';
Expand Down

0 comments on commit df8f844

Please sign in to comment.