[ClearLogs] Time out while deleting

Forge Component
Published on 2016-10-16 by Claudio Lichtenthal
1 vote
Published on 2016-10-16 by Claudio Lichtenthal

If you had trouble getting the homepage to load because of timeouts then you might also get a time out when deleting logs. (again this is for sql server)

You can get around this by breaking it into smaller chunks. In the DeleteLogs action , open the DeleteLogs advanced sql. Change it to something like

SyntaxEditor Code Snippet

DELETE TOP (1000000) FROM dbo.oslog@TableName ;

Adjust the number as necessary. I started with something even lower and put it in a timer to run over and over.  Once your logs are under control you may want to remove this limit. You could also consider using truncate if you have full db rights. That was not an option for me.