Skip to content
This repository was archived by the owner on Apr 7, 2024. It is now read-only.

Commit f37da13

Browse files
committed
remove pages that has been unpublished or has incorrectly been generated
issue #66
1 parent 939ea68 commit f37da13

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ScheduledJobs/StaticWebScheduledJob.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ protected void RemoveObsoletePages(SiteConfigurationElement configuration)
299299
IContent contentData = UrlResolver.Current.Route(new UrlBuilder(siteUrl + url));
300300

301301
// Does page exists?
302-
var pageExists = contentData != null;
303-
if (!pageExists)
302+
if (!(contentData is PageData page) || !page.CheckPublishedStatus(PagePublishedStatus.Published))
304303
{
305304
// remove index.html file as it doesn't exist in EpiServer
306305
info.Delete();

0 commit comments

Comments
 (0)