Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/prioritize templates job #1983

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2280,7 +2280,7 @@ public void run() {
public void accept(Account account) {
AccountSettingsDao.instance.getStats();
Intercom.setToken(System.getenv("INTERCOM_TOKEN"));
setDashboardVersionForAccount();
// setDashboardVersionForAccount();
}
}, "context-initializer");

Expand All @@ -2291,12 +2291,13 @@ public void accept(Account account) {

logger.info("Starting init functions and scheduling jobs at " + now);

AccountTask.instance.executeTask(new Consumer<Account>() {
@Override
public void accept(Account account) {
runInitializerFunctions();
}
}, "context-initializer-secondary");
// AccountTask.instance.executeTask(new Consumer<Account>() {
// @Override
// public void accept(Account account) {
// runInitializerFunctions();
// }
// }, "context-initializer-secondary");
setUpTestEditorTemplatesScheduler();

crons.trafficAlertsScheduler();
crons.insertHistoricalDataJob();
Expand All @@ -2315,7 +2316,6 @@ public void accept(Account account) {
setUpWebhookScheduler();
cleanInventoryJobRunner();
setUpDefaultPayloadRemover();
setUpTestEditorTemplatesScheduler();
setUpDependencyFlowScheduler();
tokenGeneratorCron.tokenGeneratorScheduler();
crons.deleteTestRunsScheduler();
Expand Down Expand Up @@ -3333,9 +3333,14 @@ public static void processTemplateFilesZip(byte[] zipFile, String author, String
String testConfigId = testConfig.getId();

existingTemplatesInDb = mapIdToHash.get(testConfigId);

loggerMaker.infoAndAddToDb("Trying to add test yaml: " + testConfigId + " existingTemplatesInDb: " + existingTemplatesInDb, LogDb.DASHBOARD);

if (existingTemplatesInDb != null && existingTemplatesInDb.size() == 1) {
loggerMaker.infoAndAddToDb("Trying to add test yaml: " + testConfigId + " existingTemplatesInDb size: " + existingTemplatesInDb.size(), LogDb.DASHBOARD);

int existingTemplateHash = existingTemplatesInDb.get(0).getHash();
loggerMaker.infoAndAddToDb("Hashes: " + testConfigId + " hashDB: " + existingTemplateHash + " template: " + templateContent.hashCode(), LogDb.DASHBOARD);

if (existingTemplateHash == templateContent.hashCode()) {
countUnchangedTemplates++;
if(TestConfig.isTestMultiNode(testConfig)){
Expand All @@ -3346,6 +3351,7 @@ public static void processTemplateFilesZip(byte[] zipFile, String author, String
loggerMaker.infoAndAddToDb("Updating test yaml: " + testConfigId, LogDb.DASHBOARD);
}
}
loggerMaker.infoAndAddToDb("Reached end: " + testConfigId, LogDb.DASHBOARD);

} catch (Exception e) {
loggerMaker.errorAndAddToDb(e,
Expand Down
Loading