2016-07-22 00:59:11 +00:00
|
|
|
|
import {Cert} from "./index.ts";
|
2016-07-22 00:11:04 +00:00
|
|
|
|
import * as plugins from "./cert.plugins";
|
|
|
|
|
import * as paths from "./cert.paths";
|
|
|
|
|
|
|
|
|
|
let firstCall = true;
|
2016-07-22 00:59:11 +00:00
|
|
|
|
let enoughTime = false;
|
2016-07-22 00:11:04 +00:00
|
|
|
|
export let accountsKeyPresent = () => {
|
|
|
|
|
let done = plugins.q.defer();
|
|
|
|
|
if (firstCall) {
|
|
|
|
|
done.resolve();
|
|
|
|
|
firstCall = false;
|
2016-07-22 00:59:11 +00:00
|
|
|
|
} else {
|
|
|
|
|
setTimeout(done.resolve,5000);
|
2016-07-22 00:11:04 +00:00
|
|
|
|
};
|
|
|
|
|
return done.promise;
|
2016-07-22 00:59:11 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export let scheduleRetry = (domainArg:string,certClassArg:Cert) => {
|
|
|
|
|
let done = plugins.q.defer();
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
certClassArg.getDomainCert(domainArg)
|
|
|
|
|
.then(done.resolve);
|
2016-07-22 01:28:30 +00:00
|
|
|
|
},20000);
|
2016-07-22 00:59:11 +00:00
|
|
|
|
return done.promise;
|
2016-07-22 00:11:04 +00:00
|
|
|
|
};
|