@bragduck/cli 2.16.0 → 2.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4738,10 +4738,32 @@ async function syncSingleService(sourceType, options, TOTAL_STEPS) {
4738
4738
  const adapter = AdapterFactory.getAdapter(sourceType);
4739
4739
  const repoSpinner = createStepSpinner(2, TOTAL_STEPS, "Validating repository");
4740
4740
  repoSpinner.start();
4741
- await adapter.validate();
4742
- const repoInfo = await adapter.getRepositoryInfo();
4743
- succeedStepSpinner(repoSpinner, 2, TOTAL_STEPS, `Repository: ${theme.value(repoInfo.fullName)}`);
4744
- logger.log("");
4741
+ const VALIDATION_TIMEOUT = 3e4;
4742
+ let repoInfo;
4743
+ try {
4744
+ repoInfo = await Promise.race([
4745
+ (async () => {
4746
+ await adapter.validate();
4747
+ return await adapter.getRepositoryInfo();
4748
+ })(),
4749
+ new Promise((_, reject) => {
4750
+ setTimeout(
4751
+ () => reject(new Error("Validation timeout after 30 seconds")),
4752
+ VALIDATION_TIMEOUT
4753
+ );
4754
+ })
4755
+ ]);
4756
+ succeedStepSpinner(
4757
+ repoSpinner,
4758
+ 2,
4759
+ TOTAL_STEPS,
4760
+ `Repository: ${theme.value(repoInfo.fullName)}`
4761
+ );
4762
+ logger.log("");
4763
+ } catch (error) {
4764
+ failStepSpinner(repoSpinner, 2, TOTAL_STEPS, "Validation failed");
4765
+ throw error;
4766
+ }
4745
4767
  let days = options.days;
4746
4768
  if (!days && options.today) {
4747
4769
  days = 1;