Permalink
Browse files

Loading JSON persistency data - catch ( Throwable t ) + createNewFile()

  • Loading branch information...
1 parent ec7fc9b commit 0f6ea8c0ce2887e77c2432b70115d3d5a5b8c7fa @evgeny-goldin committed Jun 26, 2011
@@ -63,7 +63,7 @@ class MessagesPersistencyImpl implements MessagesPersistency
catch ( Throwable t )
{
def copyFile = new File( dataDirectory, "messages-failed-to-load-${ System.currentTimeMillis() }.json" )
- assert jsonFile.renameTo( copyFile )
+ assert jsonFile.with{ renameTo( copyFile ) && createNewFile() }
context.log.error( "Failed to restore JSON data from [$jsonFile.canonicalPath], copied to [$copyFile.canonicalPath]: $t", t )
return [:]

0 comments on commit 0f6ea8c

Please sign in to comment.