File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
components/notion/sources/updated-page Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ export default {
4141 } ,
4242 hooks : {
4343 async activate ( ) {
44- console . log ( "Restarting -- fetching all pages and properties" ) ;
45- const now = new Date ( ) ;
46- const propertiesToCheck = await this . _getPropertiesToCheck ( ) ;
44+ console . log ( "Activating: fetching pages and properties" ) ;
45+ this . setLastUpdatedTimestamp ( new Date ( ) ) ;
4746 const propertyValues = { } ;
47+ const propertiesToCheck = await this . _getPropertiesToCheck ( ) ;
4848 const params = this . lastUpdatedSortParam ( ) ;
4949 const pagesStream = this . notion . getPages ( this . databaseId , params ) ;
5050 for await ( const page of pagesStream ) {
@@ -57,9 +57,9 @@ export default {
5757 }
5858 }
5959 this . _setPropertyValues ( propertyValues ) ;
60- this . setLastUpdatedTimestamp ( now ) ;
6160 } ,
6261 async deactivate ( ) {
62+ console . log ( "Deactivating: clearing states" ) ;
6363 this . setLastUpdatedTimestamp ( null ) ;
6464 } ,
6565 } ,
@@ -124,6 +124,7 @@ export default {
124124
125125 if ( lastCheckedTimestamp == null ) {
126126 // recently updated (deactivated / activated), skip execution
127+ console . log ( "Awaiting restart completion: skipping execution" ) ;
127128 return ;
128129 }
129130
You can’t perform that action at this time.
0 commit comments