file:///C:/Users/s.kodagoda/Downloads/Recordings/WebstoreHealthChecks.webm
https://ismegroup-my.sharepoint.com/personal/k_samaraweera_sana-commerce_com/_layouts/15/stream.aspx?id=%2Fpersonal%2Fk%5Fsamaraweera%5Fsana%2Dcommerce%5Fcom%2FDocuments%2FRecordings%2FCall%20with%20Chamath%20and%201%20other%2D20230302%5F131457%2DMeeting%20Recording%2Emp4&ga=1
- In progress scenarios
- Fails scenarios
The job will run 15/30 min rounds.
if no one attends to it within 30 min
then 2nd 30min Will create a ticket in Azure support dashboard
https://sanacommerce.visualstudio.com/Sana%20Platform/_dashboards/dashboard/2e484f6f-c1e0-4af3-87fa-ee646881715e
it will create a record in the WebstoreHealthChecks table
1.00pm | Email Send 1 | TicketCreated 0
1.30pm | Email Send 1 | TicketCreated 1
Sana.Platform.Core > ConstantModels > Enums > HealthCheckType.cs
HealthCheckTypes Enum (InProgress/ Failed)
0 InProgress WebJobCheck
1 Failed WebjobCheck
2 InProgress BackupCronJobCheck
3 Failed BackupCronJobCheck
4 InProgress HttpMonitoringConfiguration
5 Failed HttpMonitoringConfiguration
WebJobCheck: eg Installation, Activation,Restart, SSL,OpenVPN
BackupCronJobCheck: eg Backup
HttpMonitoringConfiguration: eg Http Monitoring :
Use for Testing
select * from WebstoreHealthChecks
select * from WebStoreStates
update WebStores set WebStoreStateId =10 where WebStoreId = 1000
update WebStores set WebStoreStateId =9, ModifiedDateTime = '2023-03-02 05:34:27.867' where WebStoreId = 1000
update [dbo].[WebstoreHealthChecks] set [IsTicketCreated] =0 where WebStoreId ='57055'
Table column Explain
[Id]: unique id
,[WebStoreId]
,[HealthCheckType] : HealthCheckType enum
,[IsEmailSent]: is the email sent or not
,[IsTicketCreated] is the ticket
,[Description]: Email and ticked desc
,[WebstoreLifeCycleId]: Get the Last Stause of webstore
,[CheckExecutionDateTime]: after failed time which fail to check identify if (ticket Created date)
,[FailureOccuredTime]: Issue Failed time
,[CreatedUser]
,[CreatedDateTime]
,[ModifiedUser]
,[ModifiedDateTime]
to check the Fail scenarios update the webstore as follows
* update WebStores set WebStoreStateId =10 (uninstall inprogress)
where WebStoreId = 1000
to check inprogress/stuck senarios update webstore as folowing
* update WebStores set WebStoreStateId =9,
ModifiedDateTime = '2023-03-02 05:34:27.867' (set -2hr or old) ex: now:10pm set to 8pm
where WebStoreId = 1000
Now job will take 2hr old data
can change the config table [CloudConfigs] Table
or Sana,Platform.Portal > Local > CloudConfigs.sql
SELECT * FROM [dbo].[CloudConfigs] where [key] = 'WebjobTaskWaitingDuration'
?? Better to have Ticket ID in table
DECLARE @WebStoreStateId INT;
DECLARE @WebStoreId INT;
DECLARE @LogType INT;
DECLARE @Date DATETIME
SET @Date = GETDATE()
SET @WebStoreStateId = 26;
SET @WebStoreId = 58719
SET @LogType =5
--1 Update webstore as fail
Update WebStores set WebStoreStateId =@WebStoreStateId where WebStoreId = @WebStoreId
--2 Insert life cycle
INSERT INTO [dbo].[WebstoreLifeCycles]
([WebStoreId]
,[WebStoreStateId]
,[User]
,[Comment],[LifeCycleDate]
)
VALUES
(@WebStoreId
,@WebStoreStateId,
'400',
'Failed Applied by Manualy',
@Date)
--3. Add WebStoreLogs to attach error log
INSERT INTO [dbo].[WebStoreLogs]
([WebStoreId]
,[LogMessage]
,[LogType]
,[IsExceptionOccured]
,[LogDateTime])
VALUES
(
@WebStoreId
,'<ArrayOfSanaCloudLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SanaCloudLog>
<LogMessage>Job Failed Applied by Manually</LogMessage>
</SanaCloudLog>
</ArrayOfSanaCloudLog>
'
,@LogType
,1
,@Date)
--------------------------------------------------------------------
SELECT * from WebStores where WebStoreId = 58719
SELECT * from [dbo].[WebstoreLifeCycles] where WebStoreId = 58719
SELECT * FROM [dbo].[WebstoreHealthChecks] where WebStoreId = 58719
select * from [dbo].[WebStoreLogs] where WebStoreId = 58719
To Run web job manually
https://portal.azure.com/#home
go tot > App services
Search webjobClick the Webjobs
Search by browser (ctr + F)
WebstoreHealthCheck
Click run
---------------------------------------------------------------------------