-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dave Larrimore
committed
Nov 5, 2020
1 parent
d867512
commit 4ec4294
Showing
25 changed files
with
740 additions
and
334 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 45 additions & 7 deletions
52
force-app/main/default/classes/CpmComponentInstallCheckerController.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,55 @@ | ||
public with sharing class CpmComponentInstallCheckerController { | ||
|
||
@AuraEnabled | ||
public static void runApex(){ | ||
public static void runApex(boolean forcedRefresh){ | ||
System.debug('Running CPMInstallCheckerController.runApex'); | ||
List<AsyncApexJob> existingJobs; | ||
|
||
QueueGetInstalledPackages queueGetInstalledPackagesJob = new QueueGetInstalledPackages(); | ||
existingJobs = [SELECT Id, ApexClass.Name, Status FROM AsyncApexJob WHERE Status IN ('Holding','Queued','Preparing','Processing') AND ApexClass.Name = :queueGetInstalledPackagesJob.getJobInfo(QueuePlatformAsyncEventHelper.FIELD_APEX_CLASS_NAME) LIMIT 1]; | ||
if (existingJobs.size() == 0){ | ||
System.debug('Running queueGetInstalledPackagesJob'); | ||
System.enqueueJob(queueGetInstalledPackagesJob); | ||
Demo_Component_Manager_Settings__c appSetting = new Demo_Component_Manager_Settings__c(); | ||
List<Demo_Component_Manager_Settings__c> appSettings = [SELECT Id, Last_Library_Refresh_Date__c FROM Demo_Component_Manager_Settings__c]; | ||
|
||
if(appSettings.size() == 0){ | ||
System.debug('Initializing appSettings'); | ||
insert appSetting; | ||
}else{ | ||
appSetting = appSettings[0]; | ||
} | ||
|
||
VersionHelper.getinstalledXTAGs(null); | ||
|
||
DateTime now = datetime.now(); | ||
DateTime yesterday = now.addDays(-1); | ||
|
||
if(appSetting.Last_Library_Refresh_Date__c == null || appSetting.Last_Library_Refresh_Date__c < yesterday || forcedRefresh){ | ||
System.debug('Running refresh'); | ||
appSetting.Last_Library_Refresh_Date__c = datetime.now(); | ||
update appSetting; | ||
|
||
QueueGetInstalledPackages queueGetInstalledPackagesJob = new QueueGetInstalledPackages(); | ||
existingJobs = [SELECT Id, ApexClass.Name, Status FROM AsyncApexJob WHERE Status IN ('Holding','Queued','Preparing','Processing') AND ApexClass.Name = :queueGetInstalledPackagesJob.getJobInfo(QueuePlatformAsyncEventHelper.FIELD_APEX_CLASS_NAME) LIMIT 1]; | ||
if (existingJobs.size() == 0){ | ||
System.debug('Running queueGetInstalledPackagesJob'); | ||
System.enqueueJob(queueGetInstalledPackagesJob); | ||
} | ||
VersionHelper.getinstalledXTAGs(null); | ||
}else{ | ||
System.debug('Not Running refresh'); | ||
} | ||
} | ||
|
||
@AuraEnabled | ||
public static Demo_Component_Manager_Settings__c getAppSettings(){ | ||
System.debug('Running CPMInstallCheckerController.getAppSettings'); | ||
Demo_Component_Manager_Settings__c appSetting = new Demo_Component_Manager_Settings__c(); | ||
List<Demo_Component_Manager_Settings__c> appSettings = [SELECT Id, Last_Library_Refresh_Date__c, Initial_Config_Flag__c FROM Demo_Component_Manager_Settings__c]; | ||
|
||
if(appSettings.size() == 0){ | ||
System.debug('Initializing appSettings'); | ||
Demo_Component_Manager_Settings__c newAppSetting = new Demo_Component_Manager_Settings__c(); | ||
insert newAppSetting; | ||
}else{ | ||
appSetting = appSettings[0]; | ||
} | ||
|
||
return appSetting; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
force-app/main/default/lwc/cpmAddGithubComponent/cpmAddGithubComponent.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.