# CFX::FLUSH_RESOURCE_KVP

- **Hash:** `0xE27C97A0`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `FlushResourceKvp`
- **Side:** server (Cfx runtime native)
- **Name status:** official
- **Documentation:** described with examples
- **URL:** https://natives.borderlinerp.com/natives/CFX/FLUSH_RESOURCE_KVP

## Signature

```c
void FLUSH_RESOURCE_KVP();
```

## Returns

`void`

## Description

*Source: Cfx.re native reference*

Nonsynchronous operations will not wait for a disk/filesystem flush before returning from a write or delete call. They will be much faster than their synchronous counterparts (e.g., bulk operations), however, a system crash may lose the data to some recent operations.

This native ensures all `_NO_SYNC` operations are synchronized with the disk/filesystem.

## Usage

### Lua

```lua
FlushResourceKvp()

-- always available, by hash
Citizen.InvokeNative(0xe27c97a0)
```

### JavaScript

```js
FlushResourceKvp();

// by hash
Citizen.invokeNative('0xe27c97a0');
```

### C#

```csharp
Function.Call((Hash)0xe27c97a0);
```

## Examples

*Source: Cfx.re native reference*

```lua
-- Bulk write many <key, value> pairs to the resource KVP.
local key = "bug_%d"
local value = "unintended_feature_%d"
for i=1,10000 do
	SetResourceKvpNoSync(key:format(i), value:format(i))
end

-- Ensure all data is synchronized to the filesystem
FlushResourceKvp()
```

## See also

- [CFX::SET_RESOURCE_KVP](https://natives.borderlinerp.com/natives/CFX/SET_RESOURCE_KVP.md) — A setter for GET_RESOURCE_KVP_STRING.
- [CFX::DELETE_RESOURCE_KVP](https://natives.borderlinerp.com/natives/CFX/DELETE_RESOURCE_KVP.md)

*Sources: Cfx.re native reference.*
